math docs
    Preparing search index...

    Function wrapAngle

    • Wraps an angle (in radians) into the range [-π, π).

      An angle already inside the range is returned unchanged, bit for bit.

      This is a fast specialisation of wrap(a, -π, π). It drifts from it by roughly one ulp per turn wrapped, and past about 1e15 radians the quotient loses the angle entirely and the result folds to -π. Use wrap when the result matters more than the speed.

      Parameters

      • a: number

        the angle to wrap

      Returns number

      the angle wrapped into [-π, π)