question: public static double normalizeRadians ( double r ) { if ( r < 0 && r >= - TWO_PI ) return r + TWO_PI ; if ( r >= TWO_PI && r < FOUR_PI ) return r - TWO_PI ; if ( r >= 0 && r < TWO_PI ) return r ; r -= TWO_PI * Math . floor ( r * TWO_PI_INVERSE ) ; if ( r < 0. ) r += TWO_PI ; return r ; }
target:  Reduce an angle in radians to the range (0 - 2 Pi).