Garry's Mod Wiki

math.rad

number math.rad( number degrees )

Description

Converts an angle in degrees to it's equivalent in radians.

Arguments

1 number degrees
The angle measured in degrees.

Returns

1 number
radians

Example

Convert various angles in degrees to their equivalent in radians.

print( "Degrees: 360, Radians: " .. math.rad( 360 ) ) -- 2*pi print( "Degrees: 180, Radians: " .. math.rad( 180 ) ) -- pi print( "Degrees: 90, Radians: " .. math.rad( 90 ) ) -- pi/2 print( "Degrees: 1, Radians: " .. math.rad( 1 ) ) -- pi/180
Output: Degrees: 360, Radians: 6.2831853071796

Degrees: 180, Radians: 3.1415926535898

Degrees: 90, Radians: 1.5707963267949

Degrees: 1, Radians: 0.017453292519943

Page Links


Special Pages


Wikis

?

Render Time: 28ms

Session 0
DB GetPage 4
Generate Html 1
SaveChanges 9
Render Body 0
Render Sidebar 12