Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I use Sin Cos and Tan?

Asked by 7 years ago

I know in math class that Sin is Opp over Hyp, Cos is Opp over Adj, and Tan is Adj over hyp, but How do I use that in Roblox?

Lets say I have Brick A. Brick A is facing 20 degrees. Brick B is 10 studs away (hypotenuse) from Brick A, and its in line to where brick A is facing.

How can I use Sin / Cos / Tan in roblox to find measurements only having information of the Angle of Brick A and the Hypotenuse?

Thanks!

0
What "measurements" are you trying to obtain? What is the specific problem that you have that you need solved? BlueTaslem 18071 — 7y

1 answer

Log in to vote
3
Answered by 7 years ago

This is quite a complicated concept in Roblox, however it is quite simple. At first I thought you have to come up/research the actual formula (which I'm sure would take hours) on sin, cos and tan. However Lua has already added trigonometry in scripting.

Trigonometry is purely based upon 3 special functions:

math.sin()
math.cos()
math.tan()

Yep it's that simple :D

Consider those 3 functions as the same key you see in a scientific calculator.

For further detail, you can go to this site: http://wiki.roblox.com/index.php?title=Trigonometry as it also provides you an example on how to use it

Ad

Answer this question