Geometric Sine Construction

This page demonstrates a purely geometric algorithm for computing sin(θ) without Taylor series, lookup tables, or the built-in Math.sin function. The only transcendental operation used is the square root (via the Pythagorean theorem).

Core idea

Every angle can be expressed as a sum of terms drawn from the halving sequence 90°, 45°, 22.5°, 11.25°, … — a binary decomposition analogous to how every number can be written in binary. The algorithm finds which terms are needed, then combines the corresponding sines using the angle-addition identity.

Steps

  1. Initialise. Start with the first term: angle = 90°, sin(90°) = 1. Set the accumulated angle to 0 and the running sine to 0.
  2. Greedy selection. If adding the current angle to the accumulator does not exceed the target angle θ, include it: update the accumulator and merge the sine using the identity sin(A+B) = sin(A)·cos(B) + sin(B)·cos(A), where cosines are obtained from sines via cos = √(1 − sin²).
  3. Halve. Halve the current angle. Compute the sine of the new half-angle geometrically: on the unit circle, the half-angle sine equals half the chord length between the point at the current angle and (1, 0), which is found by Pythagoras.
  4. Repeat steps 2–3 until the accumulated angle matches θ to the desired precision (up to 100 halvings, giving roughly 30 decimal digits of accuracy).

Result

The plot below shows getSimpleSine(x) evaluated for x ∈ [0, 0.5] (i.e. angles 0°–90°). The output matches Math.sin to at least 10 decimal places.