Java Utililty Methods Angle

List of utility methods to do Angle

Description

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

Method

doubleangleToDefaultAngle(double angle)
For a given angle in radians, return the equivalent angle in the range [-PI, PI].
return (angle + Math.PI) % (-TWOPI) + Math.PI;
intangleToFacing(float angle)
angle To Facing
float facingDegrees = (float) Math.toDegrees(angle);
return (int) (facingDegrees / FACING_TO_DEGREE);
booleanangleYawinRange(float start, float end, float angle)
Return whether a -180~180 wrapped yaw angle is in the range denoted by [start, end].
if (end < start)
    return false;
if (end - start >= 360f)
    return true;
float ss = wrapYawAngle(start), se = wrapYawAngle(end), sa = wrapYawAngle(angle);
if (ss > se) {
    return ss <= sa || sa <= se;
return ss <= sa && sa <= se;