math.NormalizeAngle

From GMod Wiki

Jump to: navigation, search
Function
Syntax math.NormalizeAngle( Float angle )
Where is this used?
Description:
Converts an angle to -179 to 180 representation.
Returns: Float
Part of Library: Math
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Math.NormalizeAngle]Math.NormalizeAngle [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionThis example normalises 3 angles to show what effect this function has
Used onNewerShared.png
Code
print(math.NormalizeAngle(380))
print(math.NormalizeAngle(190))
print(math.NormalizeAngle(-30))
Output20

-170

-30
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox