namespace
Angle
An auto-wrapping angle in radians, so you never juggle % TAU by hand. Every Angle.* result is normalized into [-pi, pi), which makes diff the shortest signed rotation between two headings and lerp turn the short way around. Build from degrees with Angle.from_degrees (read back with to_degrees), take sin / cos, combine with add, and normalize any raw value with wrap. It builds on the deterministic fixed-point Math.* trig, so results are bit-identical on every platform. Arguments are positional; angles are fixed radians. Spliced in only when a program mentions Angle.*.
Angle.from_degrees(d) -> fixedDegrees to a wrapped radian angle.Angle.to_degrees(a) -> fixedRadians back to degrees.Angle.wrap(a) -> fixedNormalize any radian value to [-pi, pi).Angle.sin(a) -> fixedSine of an angle.Angle.cos(a) -> fixedCosine of an angle.Angle.add(a, b) -> fixedAdd two angles (wrapped).Angle.diff(a, b) -> fixedShortest signed rotation from a to b.Angle.lerp(a, b, t) -> fixedInterpolate along the shortest arc.Angle.diff_degrees(a: int, b: int) -> intThe signed difference between two headings in whole degrees.