Turns & Precision

Turns & Precision

Turns & Precision

This page formalises the angle unit used across ERG/GRG. Angles are measured in turns (fractions of a full rotation). We also define a binary fixed-point representation for hardware/software precision.

Angle unit (turns)

A full rotation is \(1\) turn. Quarter-turn \(= \tfrac{1}{4}\), half-turn \(= \tfrac{1}{2}\), etc. Trigonometric functions are period-1 in turns: \(c(u),\, s(u)\) with \(c(0)=1,\ s(0)=0,\ c(\tfrac{1}{4})=0,\ s(\tfrac{1}{4})=1\).

Equal-angle partition (N sectors)

Choose the number of sectors \(N\) and set the step \(\Delta u = \tfrac{1}{N}\). Sampling angles: \(u_k = \tfrac{k}{N}\), \(k=0,\dots,N-1\).

Binary fixed-point turns (B bits)

Store angles as \(u = \tfrac{k}{2^{B}}\) turns with \(k \in \{0,\dots,2^{B}\!-\!1\}\). The angular resolution is \(\Delta u_B = 2^{-B}\). To get exactly \(N\) equal sectors, pick \(N\) dividing \(2^{B}\) (e.g. \(N=2^{B}\)). Then use indices \(k = m\,j\) with \(m = \tfrac{2^{B}}{N}\), \(j=0,\dots,N-1\).

0 1/8 1/4 3/8 1/2 5/8 3/4 7/8
Example with \(B = 3\) bits ⇒ \(2^{3}=8\) ticks. Increasing \(B\) doubles the ticks and the precision.

Why more bits ⇒ more accuracy

  • Circumference (chords): \( C_N \;=\; 2\,N\,r\, s\!\bigl(\tfrac{1}{2N}\bigr) \) is the inscribed \(N\)-gon perimeter; as \(N\) doubles, the step halves and the error typically drops ≈ \(\times 4\).
  • Area (sectors): \( A_N \;=\; \tfrac{N}{2}\,r^{2}\, s\!\bigl(\tfrac{1}{N}\bigr) \) behaves similarly (step-squared).

Quick reference

Inline: \( \Delta u = \tfrac{1}{N},\quad u_k = \tfrac{k}{N},\quad u = \tfrac{k}{2^{B}},\quad \Delta u_{B} = 2^{-B} \).
Display:

$$ C_{N} \;=\; 2\,N\,r\, s\!\Bigl(\frac{1}{2N}\Bigr), \qquad A_{N} \;=\; \frac{N}{2}\,r^{2}\, s\!\Bigl(\frac{1}{N}\Bigr). $$

Implementation notes

  • Keep an angle register \(k\) modulo \(2^{B}\) (wrap-around on \(B\) bits).
  • For LUTs of size \(2^{M}\) with \(M \le B\), index by \(k \gg (B-M)\).
  • Step-doubling check: compare \(N\) vs \(2N\) to gauge the remaining gap.
The Circle

The Circle

The Circle — Radius-First (Three Methods)

Principle

The circle is generated from the center. The radius is the only primitive; the perimeter is the path traced by the radius, and the area is the surface swept by its rotation. We work in turns (fractions of a full rotation), not in sexagesimal degrees.

Angles in turns & radial node

Let \(u\in[0,1)\) be an angle in turns (period \(1\)). We use period-1 trigonometric functions \(c(u), s(u)\) with \(c(0)=1, s(0)=0\) and \((c(\tfrac14), s(\tfrac14))=(0,1)\). The exact radial node is:

$$ P(u)=\bigl(r\,c(u),\; r\,s(u)\bigr). $$

Bit-friendly turns

Use fixed-point angles \(u = k/2^B\). Picking \(N\) that divides \(2^B\) makes equal-angle steps exact (\(\Delta u=1/N\)).
Optional: LUT + interpolation for \(c(u), s(u)\).

Method scope & scaling (quick key)

  • Radial Sectors (equal-angle, full turn) → no ×4.
  • Δx Trapezoidal (quarter tiling) → ×4 to get the full circle.
  • Original Projection (midpoint/right on a quadrant) → ×4.
Perimeter (equal-angle chords) is naturally full-turn (no ×4) and shared across methods.

Perimeter (shared across methods)

Equal-angle chords (full turn)

$$ \boxed{\, C_N \;=\; 2\,N\,r\,s\!\Bigl(\tfrac{1}{2N}\Bigr) \,} $$
Inscribed regular \(N\)-gon in turns. Monotone ↑ in \(N\). No quadrant scaling.
Perimeter by equal-angle chords (Δu = 1/N turns) Cartesian axes; circle r=100; sample radii and dashed chords (example N=12).
Perimeter by equal-angle chords: \(C_N = 2N r\, s(1/(2N))\) (full turn).

Area — three interchangeable builds (pick one)

Δx Trapezoidal (quarter → ×4)

$$ \Delta x=\frac{r}{N},\quad x_k=k\,\Delta x,\quad y_k=\sqrt{r^2-x_k^2} $$
$$ A_{\text{quarter}}(N)=\frac{\Delta x}{2}\!\left(y_0+2\sum_{k=1}^{N-1}y_k+y_N\right),\qquad A(N)=4\,A_{\text{quarter}}(N). $$
Under-approx on a concave arc; smooth convergence \(O(N^{-2})\).

Original Projection (midpoint/right corridor, quarter → ×4)

$$ \Delta x=\frac{r}{N},\ \ x_{k+\tfrac12}=(k+\tfrac12)\Delta x,\ \ y(x)=\sqrt{r^2-x^2} $$
$$ A^{\text{quad}}_{\text{mid}}=\sum_{k=0}^{N-1} y\!\bigl(x_{k+\tfrac12}\bigr)\,\Delta x,\qquad A^{\text{quad}}_{\text{right}}=\sum_{k=0}^{N-1} y\!\bigl(x_{k+1}\bigr)\,\Delta x, $$
$$ A_{\text{mid/right}}=4\,A^{\text{quad}}_{\text{mid/right}},\qquad A_{\text{right}}\le A_{\text{true}}\le A_{\text{mid}}. $$
Midpoint is second-order; corridor shrinks with \(N\).

Radial Sectors (equal-angle sectors, full turn)

$$ \boxed{\, A_N = \tfrac{N}{2}\,r^2\,s\!\Bigl(\tfrac{1}{N}\Bigr) \,} $$
Sum of \(N\) congruent isosceles triangles with included angle \(1/N\) turns (inscribed lower; monotone ↑ in \(N\)). No ×4.
Quarter area by Δx trapezoids (under the arc) Cartesian x–y axes; quarter arc with Δx verticals and interior trapezoids. Δx trapezoids
Quarter area by Δx trapezoids; multiply by 4 for the full circle.
Radial sector tiling (equal-angle sectors, full turn) Two example sectors on a unit circle (illustrative N=8).
Radial sectors: \(A_N=\tfrac{N}{2}r^2\,s(1/N)\) (full turn, no ×4).

Practical notes

  • Pick \(N\). If angles are \(k/2^B\) turns, choose \(N\mid 2^B\). Use step-doubling (\(N\!\to\!2N\)) to gauge the gap.
  • Monotonicity. \(C_N\) ↑ with \(N\). Δx trapezoids ↑ toward area (under-tiling). Original corridor shrinks. Radial sectors ↑ (inscribed).
  • All in turns. No degrees, no π in the constructive steps.