degtorad

Converts the given degrees to radians.

Syntax:

degtorad(deg);


Argument Description
deg The degrees to convert.


Returns: Real


Description

In GM all the trigonometric functions work in radians, but most people work in degrees and this means that to convert your degrees into radians you need to use this function. For example, degtorad(180) returns 3.14159265 radians. This function translates degrees into radians using the formula:

angle_radians = angle_degrees * pi / 180


Example:

val = degtorad(90);

This will set val to pi/2.


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