Skip to Content
Lua Quick Start Guide
book

Lua Quick Start Guide

by Gabor Szauer
July 2018
Beginner
202 pages
5h 42m
English
Packt Publishing
Content preview from Lua Quick Start Guide

Trigonometry

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
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Lua Programming

Beginning Lua Programming

Kurt Jung, Aaron Brown
Vim Masterclass

Vim Masterclass

Jason Cannon

Publisher Resources

ISBN: 9781789343229Supplemental Content