Some interactive applications such as games rely heavily on trigonometry. Trigonometry is used to figure out the distance between two points, to render a world, and much more. Lua provides the following trig functions. Remember, all of these functions return radians, not degrees:
- math.acos(v): returns the inverse cosine of a number in radians
- math.asin(v): returns the inverse sine of a number in radians
- math.atan(v): returns the inverse tangent of a number in radians; v is assumed to be x / y
- math.atan(x, y): returns the inverse tangent of a number in radians
- math.cos(v): returns the cosine of a number in radians
- math.sin(v): returns the sine of a number in radians
- math.tan(v): returns the tangent of a number in radians