Garry's Mod Wiki

Garry's Mod Wiki

  number math.AngleDifference( number a, number b )

Description

Calculates the difference between two angles.

Arguments

1 number a
The first angle.
2 number b
The second angle.

Returns

1 number
The difference between the angles between -180 and 180

Example

Find the angle difference between various angles

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))
Output: Angle difference between 159 and 240 is -81
Angle difference between 240 and 159 is 81
Angle difference between 58 and 145 is -87

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...