{"openapi":"3.1.0","info":{"title":"Complex Number API","version":"1.0.0","description":"Complex-number maths as an API, computed locally and deterministically. The arithmetic endpoint adds, subtracts, multiplies or divides two complex numbers z₁ = a + bi and z₂ = c + di, returning the result in both rectangular (a + bi) and polar (modulus ∠ angle) form. The properties endpoint describes a single complex number — its modulus |z| = √(a² + b²), its argument in radians and degrees, its conjugate, its negation, its reciprocal and its polar form. The power endpoint applies De Moivre's theorem, zⁿ = rⁿ(cos nθ + i·sin nθ), to raise a complex number to any real power, and for a positive integer n it also returns all n distinct n-th roots, evenly spaced around the complex plane. The imaginary part defaults to zero, so real inputs work too. Everything is computed locally and deterministically, so it is instant and private. Ideal for engineering, signal-processing, electronics, physics and mathematics app developers, AC-circuit and phasor tools, and STEM education. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is complex-number arithmetic; for plane-angle unit conversion use an angle API and for vectors a vector API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/complexnumber-api","description":"oanor gateway"}],"tags":[{"name":"Complex"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/arithmetic":{"get":{"operationId":"get_v1_arithmetic","tags":["Complex"],"summary":"Complex arithmetic","description":"","parameters":[{"name":"a","in":"query","required":true,"description":"Real part of z₁","schema":{"type":"string"},"example":"3"},{"name":"b","in":"query","required":false,"description":"Imaginary part of z₁","schema":{"type":"string"},"example":"4"},{"name":"c","in":"query","required":true,"description":"Real part of z₂","schema":{"type":"string"},"example":"1"},{"name":"d","in":"query","required":false,"description":"Imaginary part of z₂","schema":{"type":"string"},"example":"2"},{"name":"op","in":"query","required":false,"description":"add, subtract, multiply or divide","schema":{"type":"string"},"example":"multiply"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Complex arithmetic on z₁ = a+bi and z₂ = c+di. Result given in rectangular and polar form.","inputs":{"op":"multiply","z1":"3 + 4i","z2":"1 + 2i"},"result":{"real":-5,"modulus":11.180339887,"imaginary":10,"polar_form":"11.18034 ∠ 116.565051°","rectangular":"-5 + 10i","argument_deg":116.565051177,"argument_rad":2.034443936}},"meta":{"timestamp":"2026-06-04T18:38:04.315Z","request_id":"f35c1dd0-1a0c-4807-8303-6562da10088e"},"status":"ok","message":"Arithmetic","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/power":{"get":{"operationId":"get_v1_power","tags":["Complex"],"summary":"Power & roots","description":"","parameters":[{"name":"a","in":"query","required":true,"description":"Real part","schema":{"type":"string"},"example":"8"},{"name":"b","in":"query","required":false,"description":"Imaginary part","schema":{"type":"string"},"example":"0"},{"name":"n","in":"query","required":true,"description":"Exponent (positive integer for roots)","schema":{"type":"string"},"example":"3"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"De Moivre: zⁿ = rⁿ·(cos nθ + i·sin nθ). For a positive integer n the n distinct n-th roots are also returned.","power":{"real":512,"modulus":512,"imaginary":0,"polar_form":"512 ∠ 0°","rectangular":"512","argument_deg":0,"argument_rad":0},"roots":[{"real":2,"modulus":2,"imaginary":0,"polar_form":"2 ∠ 0°","rectangular":"2","argument_deg":0,"argument_rad":0},{"real":-1,"modulus":2,"imaginary":1.732050808,"polar_form":"2 ∠ 120°","rectangular":"-1 + 1.732051i","argument_deg":120,"argument_rad":2.094395102},{"real":-1,"modulus":2,"imaginary":-1.732050808,"polar_form":"2 ∠ -120°","rectangular":"-1 - 1.732051i","argument_deg":-120,"argument_rad":-2.094395102}],"inputs":{"n":3,"z":"8"},"roots_count":3},"meta":{"timestamp":"2026-06-04T18:38:04.435Z","request_id":"c0fbab7e-2f1f-4dd0-b14d-04860a01e672"},"status":"ok","message":"Power & roots","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/properties":{"get":{"operationId":"get_v1_properties","tags":["Complex"],"summary":"Properties","description":"","parameters":[{"name":"a","in":"query","required":true,"description":"Real part","schema":{"type":"string"},"example":"3"},{"name":"b","in":"query","required":false,"description":"Imaginary part","schema":{"type":"string"},"example":"4"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"|z| = √(a²+b²), arg = atan2(b,a). Conjugate flips the imaginary sign; reciprocal = conjugate/|z|².","real":3,"inputs":{"z":"3 + 4i"},"modulus":5,"negation":"-3 - 4i","conjugate":"3 - 4i","imaginary":4,"polar_form":"5 ∠ 53.130102°","reciprocal":"0.12 - 0.16i","rectangular":"3 + 4i","argument_deg":53.130102354,"argument_rad":0.927295218},"meta":{"timestamp":"2026-06-04T18:38:04.519Z","request_id":"10f2d9b8-2c67-4929-9ea1-e4752c597244"},"status":"ok","message":"Properties","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"notes":"Numbers entered as real/imaginary parts (a, b and c, d). Angles reported in radians and degrees. The imaginary part defaults to 0.","service":"complexnumber-api","formulae":{"divide":"(a+bi)/(c+di) = ((ac+bd) + (bc−ad)i)/(c²+d²)","modulus":"|z| = √(a²+b²)","argument":"arg(z) = atan2(b, a)","multiply":"(a+bi)(c+di) = (ac−bd) + (ad+bc)i","de_moivre":"zⁿ = rⁿ(cos nθ + i sin nθ)"},"endpoints":{"GET /v1/meta":"This document.","GET /v1/power":"zⁿ via De Moivre, plus the n-th roots when n is a positive integer.","GET /v1/arithmetic":"Add, subtract, multiply or divide two complex numbers.","GET /v1/properties":"Modulus, argument, conjugate, reciprocal and polar form of one number."},"description":"Complex-number calculator: arithmetic on two complex numbers, properties of one (modulus, argument, conjugate, reciprocal, polar form), and powers and roots via De Moivre's theorem."},"meta":{"timestamp":"2026-06-04T18:38:04.622Z","request_id":"0ac6c90c-f8e8-4207-8bc3-fda5d6de401c"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":3000,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":500,"monthly_call_quota":40000,"rps_limit":5,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1500,"monthly_call_quota":250000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":4900,"monthly_call_quota":1514000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/complexnumber-api"}