Package com.trimblemaps.mapsdk.location
Class Utils
java.lang.Object
com.trimblemaps.mapsdk.location.Utils
-
Method Summary
Modifier and TypeMethodDescriptionstatic floatnormalize(float angle) Normalizes an angle to be in the [0, 360] range.static floatshortestRotation(float heading, float previousHeading) Util for finding the shortest path from the current rotated degree to the new degree.
-
Method Details
-
shortestRotation
public static float shortestRotation(float heading, float previousHeading) Util for finding the shortest path from the current rotated degree to the new degree.- Parameters:
heading- the new position of the rotationpreviousHeading- the current position of the rotation- Returns:
- the shortest degree of rotation possible
-
normalize
public static float normalize(float angle) Normalizes an angle to be in the [0, 360] range.- Parameters:
angle- the provided angle- Returns:
- the normalized angle
-