@robireton/circle
v1.2.1
Published
ES6 module for working with angles in circles
Downloads
17
Readme
circle
ES6 module for working with angles in circles
usage
import circle from '@robireton/circle'
circle.DegreesToRadians(90)
methods
DegreesToRadians( number
)
arguments
number
: an angle expressed in degrees
returns
number
: an angle expressed in radians
example
circle.DegreesToRadians(90)
// => 1.5707963267948966
RadiansToDegrees( number
)
arguments
number
: an angle expressed in radians
returns
number
: an angle expressed in degrees
example
circle.RadiansToDegrees(Math.PI)
// => 180
normalizedDegrees( number
)
arguments
number
: an angle expressed in degrees
returns
number
: an angle expressed in degrees in the interval [0, 360)
example
circle.normalizedDegrees(1122)
// => 42
normalizedRadians( number
)
arguments
number
: an angle expressed in radians
returns
number
: an angle expressed in radians in the interval [0, 2π)
example
circle.normalizedRadians(-12.3)
// => 0.26637061435917175
DDtoDMS( number
)
decimal degrees to degrees, minutes, and seconds
arguments
number
: an angle expressed in degrees
returns
string
: an angle formatted as d° m′ sʺ (that space is a narrow no-break space, U+202F)
example
circle.DDtoDMS(42.1024)
// => '42° 6′ 8ʺ'