radtodeg

Converts radians to degrees.

Syntax:

radtodeg(rad);


Argument Description
rad The radians to convert.


Returns: Real


Description

Once you have done your calculations using sin, or cos etc... the result is in radians. This may not always be what you want and so to turn the radians into degrees we use this function. For example, radtodeg(sin(180)) will return -45 degrees. This function translates radians into degrees using the formula:

angle_degrees = angle_radians * 180 / pi;


Example:

val = radtodeg( pi );

This will set val to 180.


Back: Real Number Functions
Next: lengthdir_x
© Copyright YoYo Games Ltd. 2018 All Rights Reserved