Maths · function

wrapAngle

Fold an angle into (-π, π]. Simulation state uses this so a long session cannot accumulate an unbounded angle and lose float precision. Anything replaying a recorded session depends on staying bit-stable over its length.

Explained in Coordinates and units.

function wrapAngle(a: number): number
import { wrapAngle } from '@driftengine/core';

Parameters

ParameterTypeDescription
anumber