Reference angleMode()

angleMode()

Changes the unit system used to measure angles.

Degrees and radians are both units for measuring angles. There are 360˚ in one full rotation. A full rotation is 2 × π (about 6.28) radians.

Functions such as rotate() and sin() expect angles measured radians by default. Calling angleMode(DEGREES) switches to degrees. Calling angleMode(RADIANS) switches back to radians.

Calling angleMode() with no arguments returns current angle mode, which is either RADIANS or DEGREES.

Examples

Syntax

angleMode(mode)
angleMode()

Parameters

mode
Constant:

either RADIANS or DEGREES.

Notice any errors or typos? Please let us know. Please feel free to edit src/math/trigonometry.js and open a pull request!

Related References