List of utility methods to do Angle Convert
float | constrainAngle(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; |
float | difference(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;
|
float | normalize(final float angle) Normalize an angle so that it belongs to the [0, 360[ range. return (angle >= 0 ? angle : (360 - ((-angle) % 360))) % 360;
|