canonical

The equivalent angle wrapped to a single turn — the representative in (−180°, 180°], so (-270).deg.canonical == 90.deg.

Folds the raw radians by whole turns into (−π, π]; the half turn answers +π ((-180).deg.canonical == 180.deg). A value already inside the range comes back unchanged — the raw fold arithmetic runs only outside it, so wrapping never perturbs an in-range angle and the property is exactly idempotent. A wrapped difference of two headings is the shortest signed turn between them.