You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
362 B
19 lines
362 B
|
|
/** |
|
* Convert given value's base into the parameter unitName |
|
* |
|
* @param {Double} value |
|
* @param {String} unitName |
|
* @return {Double} |
|
* @api private |
|
*/ |
|
|
|
module.exports = function convertAngle(value, unitName) { |
|
var factors = { |
|
"rad" : 1, |
|
"deg" : 180 / Math.PI, |
|
"turn": 0.5 / Math.PI, |
|
"grad": 200 / Math.PI |
|
} |
|
return value * factors[unitName]; |
|
}
|
|
|