Android Utililty Methods Angle Convert

List of utility methods to do Angle Convert

Description

The list of methods to do Angle Convert are organized into topic(s).

Method

floatconstrainAngle(float degree)
Constrain a given degree to between 0-359
while (degree < 0.0f || degree >= 360.0f) {
    if (degree < 0.0f)
        degree = 360.0f + degree;
    else if (degree >= 360.0f)
        degree -= 360.0f;
return degree;
floatdifference(final float from, final float to)
Return the angle to turn of to go from an angle to the other
return normalize(to - from + 180) - 180;
floatnormalize(final float angle)
Normalize an angle so that it belongs to the [0, 360[ range.
return (angle >= 0 ? angle : (360 - ((-angle) % 360))) % 360;