degtorad

Converts the given degrees to radians.

Syntax:

GML Code Example

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:

GML Code Example

angle_radians = angle_degrees * pi / 180


Example:

GML Code Example

val = degtorad(90);

This will set val to pi/2.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here