Mirror Engine API / math / lerpAngle
function lerpAngle(a: number, b: number, alpha: number): number
Calculates the linear interpolation of two angles ensuring that interpolation is correctly performed across the 360 to 0 degree boundary. Angles are supplied in degrees.
number
Angle (in degrees) to linearly interpolate from.
number
Angle (in degrees) to linearly interpolate to.
number
The value controlling the result of interpolation. When alpha is 0, a is returned. When alpha is 1, b is returned. Between 0 and 1, a linear interpolation between a and b is returned. alpha is clamped between 0 and 1.
number
The linear interpolation of two angles.