question: public static double clampAngle ( double angle ) { double newAngle = angle % 360 ; if ( newAngle < 0 ) newAngle = 360 + newAngle ; return newAngle ; }
target:  Clamp an angle (in degrees) to 360, and transform negative angles into their positive counterparts.