convert-angle
v1.0.0
Published
Convert effortlessly between degrees and radians
Downloads
2
Maintainers
Readme
convert-angle
Convert effortlessly between degrees and radians
Install
$ npm install --save convert-angle
Usage
var convertAngle = require('convert-angle');
convertAngle(Math.PI, 'radians');
//=> 180
convertAngle(90, 'degrees');
//=> 1.5707963267948966
convertAngle(Math.PI / 2, 'r');
//=> 90
convertAngle(45, 'd');
//=> 0.7853981633974483
API
convertAngle(angle, unit)
angle
Required
Type: number
The value of the angle
unit
Required
Type: string
The unit that this angle is in.
Must be one of degrees, d, radians, r
Depends on:
degrees-radians
radians-degrees
License
MIT © Siddharth Kannan