{"openapi":"3.1.0","info":{"title":"Triangle Solver API","version":"1.0.0","description":"Triangle-solving maths as an API, computed locally and deterministically. The solve endpoint solves any triangle from three values — three sides (SSS), two sides and the included angle (SAS), two angles and a side (ASA/AAS), or the ambiguous two-sides-and-a-non-included-angle case (SSA) — using the law of cosines and the law of sines, and returns all three sides and angles, the perimeter, the Heron area and whether the triangle is acute, right or obtuse and equilateral, isosceles or scalene; for an ambiguous SSA input it also returns the second valid triangle. The right endpoint is a dedicated right-triangle solver from any two of the two legs, the hypotenuse and an acute angle, applying Pythagoras and basic trigonometry. The points endpoint builds a triangle from three cartesian vertices, giving the side lengths, the interior angles, the shoelace area and the centroid. Angles are in degrees. Everything is computed locally and deterministically, so it is instant and private. Ideal for education, CAD, surveying, game-development and engineering app developers, geometry and trigonometry tools, and STEM teaching. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This solves triangles; for areas and volumes of general shapes use a geometry API and for polygon point-set operations a polygon API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/triangle-api","description":"oanor gateway"}],"tags":[{"name":"Triangle"},{"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/points":{"get":{"operationId":"get_v1_points","tags":["Triangle"],"summary":"Triangle from points","description":"","parameters":[{"name":"ax","in":"query","required":true,"description":"Ax","schema":{"type":"string"},"example":"0"},{"name":"ay","in":"query","required":true,"description":"Ay","schema":{"type":"string"},"example":"0"},{"name":"bx","in":"query","required":true,"description":"Bx","schema":{"type":"string"},"example":"4"},{"name":"by","in":"query","required":true,"description":"By","schema":{"type":"string"},"example":"0"},{"name":"cx","in":"query","required":true,"description":"Cx","schema":{"type":"string"},"example":"0"},{"name":"cy","in":"query","required":true,"description":"Cy","schema":{"type":"string"},"example":"3"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"area":6,"note":"Side a = |BC|, b = |CA|, c = |AB|. Area by the shoelace formula; centroid is the average of the vertices.","inputs":{"A":[0,0],"B":[4,0],"C":[0,3]},"side_a":5,"side_b":3,"side_c":4,"centroid":[1.333333,1],"perimeter":12,"side_type":"scalene","angle_type":"right","angle_A_deg":90,"angle_B_deg":36.869898,"angle_C_deg":53.130102},"meta":{"timestamp":"2026-06-04T18:38:07.071Z","request_id":"432f669a-2777-4c65-a6e6-4f09543db665"},"status":"ok","message":"From points","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/right":{"get":{"operationId":"get_v1_right","tags":["Triangle"],"summary":"Right triangle","description":"","parameters":[{"name":"leg_a","in":"query","required":false,"description":"Leg a","schema":{"type":"string"},"example":"3"},{"name":"leg_b","in":"query","required":false,"description":"Leg b","schema":{"type":"string"},"example":"4"},{"name":"hypotenuse","in":"query","required":false,"description":"Hypotenuse","schema":{"type":"string"}},{"name":"angle","in":"query","required":false,"description":"An acute angle (deg)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"area":6,"note":"Right triangle: c² = a² + b² (Pythagoras); angle A = asin(a/c), opposite leg a.","leg_a":3,"leg_b":4,"perimeter":12,"hypotenuse":5,"angle_A_deg":36.869898,"angle_B_deg":53.130102,"angle_C_deg":90},"meta":{"timestamp":"2026-06-04T18:38:07.177Z","request_id":"394f97e2-f442-4369-8f54-6f6567b8d07b"},"status":"ok","message":"Right triangle","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/solve":{"get":{"operationId":"get_v1_solve","tags":["Triangle"],"summary":"Solve a triangle","description":"","parameters":[{"name":"side_a","in":"query","required":false,"description":"Side a (opposite angle A)","schema":{"type":"string"},"example":"3"},{"name":"side_b","in":"query","required":false,"description":"Side b","schema":{"type":"string"},"example":"4"},{"name":"side_c","in":"query","required":false,"description":"Side c","schema":{"type":"string"},"example":"5"},{"name":"angle_A","in":"query","required":false,"description":"Angle A (deg)","schema":{"type":"string"}},{"name":"angle_B","in":"query","required":false,"description":"Angle B (deg)","schema":{"type":"string"}},{"name":"angle_C","in":"query","required":false,"description":"Angle C (deg)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"area":6,"method":"SSS","side_a":3,"side_b":4,"side_c":5,"perimeter":12,"side_type":"scalene","angle_type":"right","angle_A_deg":36.869898,"angle_B_deg":53.130102,"angle_C_deg":90},"meta":{"timestamp":"2026-06-04T18:38:07.284Z","request_id":"0980a284-83e9-47c1-8678-5000a931d492"},"status":"ok","message":"Solve triangle","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":"Angles in degrees; side a is opposite angle A. SSA can be ambiguous — a second_solution is returned when one exists.","service":"triangle-api","formulae":{"shoelace":"½|ax(by−cy)+bx(cy−ay)+cx(ay−by)|","heron_area":"√(s(s−a)(s−b)(s−c)), s = (a+b+c)/2","law_of_sines":"a/sinA = b/sinB = c/sinC","law_of_cosines":"a² = b² + c² − 2bc·cosA"},"endpoints":{"GET /v1/meta":"This document.","GET /v1/right":"Right-triangle solver from any two of leg_a, leg_b, hypotenuse, angle.","GET /v1/solve":"Solve a triangle from three values (SSS, SAS, ASA, AAS or SSA).","GET /v1/points":"Sides, angles, area and centroid from three vertices."},"description":"Triangle solver: solve any triangle from SSS, SAS, ASA, AAS or the ambiguous SSA case; a dedicated right-triangle solver; and a triangle from three cartesian points."},"meta":{"timestamp":"2026-06-04T18:38:07.392Z","request_id":"a516dc07-849d-45eb-9f77-e461fcb4eab2"},"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":300000,"rps_limit":15,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":4900,"monthly_call_quota":2009000,"rps_limit":40,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/triangle-api"}