public static double wrapAngleRad ( double angle ) { angle %= TrigMath . TWO_PI ; if ( angle <= - TrigMath . PI ) { return angle + TrigMath . TWO_PI ; } if ( angle > TrigMath . PI ) { return angle - TrigMath . TWO_PI ; } return angle ; }
Wraps the radian between - PI and PI