math.AngleDifference

From GMod Wiki

Jump to: navigation, search
Function
Syntax math.AngleDifference( Float a, Float b )
Where is this used?
Description:
Returns the difference between two angles.
Returns: Float
Part of Library: Math
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Math.AngleDifference]Math.AngleDifference [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionGet angle difference
Used onNewerShared.png
Code
print("Angle difference between 159 and 240 is " .. math.AngleDifference(159, 240))
print("Angle difference between 240 and 159 is " .. math.AngleDifference(240, 159))
print("Angle difference between 58 and 145 is " .. math.AngleDifference(58, 145))
OutputAngle difference between 159 and 240 is -81

Angle difference between 240 and 159 is 81

Angle difference between 58 and 145 is -87
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox