function mod2pi(x) {
    var b = x / (2 * Math.PI);
    var a = (2 * Math.PI) * (b - abs_floor(b));
    if (a < 0) a = (2 * Math.PI) + a;
    return a;
}
// return an angle in the range 0 to 2pi radians

return an angle in the range 0 to 2pi radians
return an angle in the range 0 to 2pi radians
function mod2pi(x) {
    var b = x / (2 * Math.PI);
    var a = (2 * Math.PI) * (b - abs_floor(b));
    if (a < 0) a = (2 * Math.PI) + a;
    return a;
}
function mod2pi ( x ) { var b = x / ( 2 * Math . PI ) ; var a = ( 2 * Math . PI ) * ( b - abs_floor ( b ) ) ; if ( a < 0 ) a = ( 2 * Math . PI ) + a ; return a ; }
return an angle in the range 0 to 2pi radians
return an angle in the range 0 to 2pi radians