Conversion Functions

Angle in a circle A part of a circle or an angle can be measured in different units: degrees, radians, gradians or cycles. With the conversion functions an angle can be converted easily from one angle unit to another, for example from degrees to radians.


The following conversion functions are available.
Function Description
Rad2Deg(x) Convert x from radians to degrees
One radian is equal to 360/(2*Pi) degrees

Rad2Grad(x) Convert x from radians to gradians
One radian is equal to 400/(2*Pi) gradians

Rad2Cycle(x) Convert x from radians to cycles
One radian is equal to 1/(2*Pi) cycles

Deg2Rad(x) Convert x from degrees to radians
One degree is equal to 2*Pi/360 radians

Grad2Rad(x) Convert x from gradians to radians
One gradian is equal to 2*Pi/400 radians

Cycle2Rad(x) Convert x from cycles to radians
One cycle contains 2*Pi radians

Back to top


'Examples of using Conversion functions

'set the system variable angles to radians
Angles = Rad
       Angles mode set to Radians

'suppose an angle is given in degrees
myAngle = 45
       myAngle = 45

'calculate the angle in radians
myAngleRadians = Deg2Rad(myAngle)
       myAngleRadians = 0.785398163

'calculate the sine of the angle
       Ans = 0.707106781

'Some special values
Rad2Cycle(2 * Pi)
       Ans = 1
Rad2Deg(2 * Pi)
       Ans = 360
Rad2Grad(2 * Pi)
       Ans = 400
Rad2Deg(0.25 * Pi)
       Ans = 45
Rad2Grad(1 * Pi)
       Ans = 200

'You can use combinations of conversion functions
'to convert for example from degrees to cycles
       Ans = 1
       Ans = 180
Back to top

See Also

Angles settings, Functions Overview, Functionstree