@mocanvas/editor · function

shortAngleDist

declare function shortAngleDist(a0: number, a1: number): number

The shortest signed turn from a0 to a1, in (-π, π]. Use this rather than a1 - a0 whenever an angle may have wrapped.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.