Commit 24dbdd0a authored by Nico Mack's avatar Nico Mack

Added constrainTwoPi method

parent 73ceaab9
......@@ -50,11 +50,25 @@ public class AngleUtils {
// * Class Body
// ***************************************************************************
// ---------------------------------------------------------------------------
/**
* @param rawAngle
* @return
*/
// ---------------------------------------------------------------------------
public static double constrainTwoPi(double rawAngle) {
if (rawAngle < 0)
rawAngle += TWO_PI;
return Math.min(rawAngle, TWO_PI);
}
// ---------------------------------------------------------------------------
/**
* @param rawAngle
* @return
*/
// ---------------------------------------------------------------------------
public static double moduloTwoPi(double rawAngle) {
double angle = rawAngle % TWO_PI;
if (angle < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment