interpolateAngle180

fun interpolateAngle180(amount: Double, angle1: Angle, angle2: Angle): Angle

Computes the linear interpolation of two angles in the range -180, +180 degrees according to a specified fractional amount. The fractional amount is interpreted as a relative proportion of the two angles, where 0.0 indicates the first angle, 0.5 indicates an angle half way between the two angles, and 1.0 indicates the second angle.
The result of this method is undefined if the amount is outside the range 0, 1.

Return

the interpolated angle in the range -180, +180 degrees

Parameters

amount

the fractional proportion of the two angles in the range 0, 1

angle1

the first angle in degrees

angle2

the second angle in degrees