Angle

From Garry's Mod
Jump to: navigation, search
 Angle( )

Contents

Description

Creates an Angle object.

Arguments

number pitch=0

The pitch value of the angle.
If this is an Angle, this function will return a copy of the given angle.
If this is a string, this function will try to parse the string as a angle. If it fails, it returns a 0 angle.

(See examples)

Arguments

number yaw=0

The yaw value of the angle.

Arguments

number roll=0

The roll value of the angle.

Returns

Angle

Created angle

Examples

Example

Creates an angle and prints the value to the console.

print( Angle( 1, 2, 3 ) )
print( Angle( "4 5 6" ) )
local test = Angle( 7, 8, 9 )
print( Angle( test ) )

print( Angle( "4 5 test" ) )
print( Angle() )

Output:

1.00 2.00 3.00
4.00 5.00 6.00
7.00 8.00 9.00

0.00 0.00 0.00
0.00 0.00 0.00
Personal tools
Navigation