Convert between degree and radians - Node.js Geometry

Node.js examples for Geometry:Radian

Description

Convert between degree and radians

Demo Code

/*//www .  j a  v a2 s . co  m
 * Convert between degree and radians
 */
function degToRad(deg) {
  return (deg*Math.PI) / 180;
}

/*
 * Convert between radians and degrees
 */

function radToDeg(rad) {
  return (rad*180)/Math.PI;
}

Related Tutorials