- Documentation
- Math, vectors and matrices
Category
Math, vectors and matrices
All Lua functions and events in the Math, vectors and matrices category, on the server and the client.
Shared functions 7
getReturns the shortest difference between two angles in degrees, in the range -180 to 180. Positive when you need to turn towards the increasing angle.Angle Difference getConverts a heading (like the Z rotation in GTA) and pitch in degrees into a unit direction vector.Direction From Rotation getReturns a point at the given distance fromPoint From Distance Rotation (x, y)in the given direction. Angles as in GTA: 0 is north and they grow counter-clockwise.interpolateComputes an angle between two angles, going the shorter way. The result is in the 0-360 range.Angle isChecks whether a value is a matrix (aMatrix Matrixobject).isChecks whether a value is a vector (Vector Vector2,Vector3orVector4).math.clampClamps a number to the range fromlotohi.