API

Function lerpAngleShortest

  • Blend an angle (radians) toward a goal along the shortest arc, correctly handling wrap-around past ±PI (e.g. 3.1 -> -3.1 takes the short way). This is the lightweight alternative to quaternion slerp when only a single angle is being interpolated. The result is not normalized to any particular range.

    Parameters

    • current: number

      The current angle, in radians.

    • goal: number

      The goal angle, in radians.

    • t: number

      The interpolation weight (typically from expDampFactor).

    Returns number

    The new angle, stepped t of the way along the shortest arc.