To 0 - 2 * PI, considering negative radian - Node.js Geometry

Node.js examples for Geometry:Radian

Description

To 0 - 2 * PI, considering negative radian

Demo Code



/**//from   ww w  .  j a  va  2 s  .c  o  m
 * To 0 - 2 * PI, considering negative radian.
 * @param {number} radian
 * @return {number}
 */
number.remRadian = function (radian) {
    var pi2 = Math.PI * 2;
    return (radian % pi2 + pi2) % pi2;
};

Related Tutorials