Skip to main content
Extras on top of Lua’s standard math library. Everything in Lua 5.1’s math is available too (math.abs, math.min, math.sin, …).

Lerp

Clamp

Round

Half-away-from-zero.

Sign

Remap

Errors on a zero input range.

NormalizeAngle

Wraps degrees to [-180, 180).

CalcAngle

Returns a QAngle pointing from one position to another.

GetFOV

Returns the physical angular distance (degrees) between your crosshair and a target point, always in the range 0 through 180. view_angles is a QAngle, the other two are Vector.

AngleVectors

Decomposes a QAngle into three direction Vectors. Returns all three.

VectorAngles

Converts a direction Vector to a QAngle.