Methodology

How the calculations run, why we picked the formulas we did, and how the AI explanations are produced. Updated November 8, 2026.

Where the math happens

Most calculators on this site run in your browser. The calculator engine is a single JavaScript file (calculator-engine.js) that stays in your browser cache after the first page load, so results come back in milliseconds and the numbers you type are not sent anywhere.

A few calculators do not have a browser version yet. For those — and as a fallback when the browser version cannot handle an input — the values are sent to our server, calculated there and returned. They are stored only if you are signed in, as part of your calculation history.

The other exception is "AI Solve", which is a separate button. AI Solve does call our server, which then calls an upstream AI provider. We discuss that path further down.

Why we use these specific formulas

For many geometry problems there are multiple correct formulas — but they differ in numerical behavior near edge cases. We pick the more stable variant even when it is longer. Three examples:

  • Heron's formula (area from three sides). The textbook form A = √(s(s-a)(s-b)(s-c)) where s = (a+b+c)/2 works fine for well-formed triangles but loses precision when the triangle is nearly degenerate (a + b ≈ c). We use Kahan's stable rearrangement 16A² = (a + (b+c))(c - (a-b))(c + (a-b))(a + (b-c)), evaluated in descending side-length order. The two formulas agree to 4 decimal places on textbook inputs and disagree by orders of magnitude near the degenerate boundary.
  • Law of Cosines vs Law of Sines for angle recovery. When solving SSS (three sides), the Law of Cosines gives a unique angle for each vertex via cos C = (a² + b² − c²) / (2ab). We use this in preference to recovering angles via the Law of Sines, because the Law of Sines is multivalued — the arcsin step has two solutions in (0°, 180°) and you have to manually pick the right branch. SSS via Law of Cosines is single-valued and stable.
  • SSA ambiguous case. When you give us two sides and an angle opposite one of them (the SSA pattern), the answer may be zero, one, or two valid triangles depending on the relationship between the side lengths and the given angle. We do not pretend this away — the Triangle Solver returns the primary acute solution and, when a second obtuse solution exists, adds a note showing both. The branch logic and worked example are on the Triangle Solver page.

Numerical precision

All calculations use IEEE 754 double-precision floating point (the standard JavaScript Number type, providing about 15-17 significant decimal digits). Where a result is sensitive to rounding — for example, the inverse trigonometric functions near ±1 — we clamp the input to the valid domain before evaluation. The helper gcAcos(x) evaluates Math.acos(Math.max(-1, Math.min(1, x))) so that a value of 1.0000000001 produced by accumulated floating-point error returns 0° rather than NaN.

Results are shown to up to 6 decimal places (4 for the few calculations done on our server), but the underlying calculation retains full double precision. We do not truncate intermediate values during the calculation chain.

How we test the calculators

The calculator engine carries an automated suite of textbook test cases (21 at the moment), run after changes to the engine. Sample entries include:

  • Heron's formula on a 3-4-5 right triangle (expected area = 6)
  • SSA ambiguous case at a = 6, b = 8, A = 35° (expected primary angle B ≈ 49.886°)
  • Right triangle with legs 3 and 4 (expected hypotenuse 5)
  • Sphere at r = 3 (expected volume and surface area both 36π)
  • Regular octagon (expected interior angle sum 1080°, each angle 135°)

Each case has a tolerance (typically 0.001) that the implementation must meet. We also open every calculator page in a real browser, in several languages, enter a sample problem and check that a correct result appears.

How AI Solve works

The "AI Solve" button is a separate code path from the calculator. When you click it, the inputs you typed (or the photo you uploaded) are sent, along with a system prompt that asks for a textbook-style step-by-step explanation, to a large language model from one of the AI providers we use.

Providers currently in use: DeepSeek, OpenAI. If one is unavailable, the request automatically moves to the next one.

Which provider and model answer is set by us and may change as better models become available; this list always reflects the current setup.

On calculator pages, the numeric answer above the AI explanation is always the output of our calculator engine — it is not generated by the AI. The AI's job is to explain that number, not to recompute it. If the AI's text appears to reach a different number, trust the calculator. See our Editorial Policy for our corrections process.

Limitations and what we do not compute

Geometry Calculator covers two-dimensional and three-dimensional Euclidean geometry, plane analytic geometry, and standard trigonometry. We do not currently support:

  • Non-Euclidean geometry (hyperbolic, elliptic, projective)
  • Differential geometry (curvature, tangent spaces, geodesics on curved surfaces)
  • Algebraic geometry (varieties, schemes, intersection theory)
  • Topology beyond the basic shape-classification level

Some advanced calculators on the site touch the boundary of these areas (for example, parametric curves on the coordinate plane). For production work, cross-check those results against a computer algebra system such as Mathematica or SymPy.