rotationDirection

open fun rotationDirection(from: Double, to: Double): Double

Sign of direction change needed to travel from one angle to another.

For angles that are 180 degrees apart from each other, both directions have the same travel distance, so either direction is shortest. The value 1.0 is returned in this case.

Return

-1 if decreasing from leads to the shortest travel distance, 1 if increasing from leads to the shortest travel distance.

Parameters

from

The angle travel starts from, in degrees.

to

The angle travel ends at, in degrees.