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

How do I solve for this angle Triganometry?

Asked by
LostPast 253 Moderation Voter
5 years ago
Edited 5 years ago

https://imgur.com/w7vMsyH

I am trying to figure out the angle from 0 Degrees to the Triangle's Hypotenuse. Both X and Y are input values to this function and can be positive or negative values. I need the solution in a mathematical function so I can input X and Y to get the angle.

Thanks!

0
The image for me doesn't work, but you just need a simple trigonometry equation, which is inverse of tangent(Y/X). This should give you the answer, but I am not too sure how you would write inverse of tangent in Lua. Hope this helps! Francisl4d45 7 — 5y
0
inverse of tangent is arctangent, in LUA its named as atan aazkao 787 — 5y
1
yeah, i just read some more on it. I suggest you use atan2 instead of atan. Here is why: https://scriptinghelpers.org/questions/18670/may-someone-explain-mathatan2-and-its-capabilities Francisl4d45 7 — 5y
0
Somewhat useless comment. Trigonometry not "Triganometry." (Just a heads up xdd) EpicMetatableMoment 1444 — 5y

1 answer

Log in to vote
0
Answered by
aazkao 787 Moderation Voter
5 years ago
Edited 5 years ago

Cant see your image, but basically just do this, im assuming your X and Y is the hypotenuse and the adjacent length, then multiply it by 180/pi

local angle = math.acos(Y/X)*(180/math.pi)
Ad

Answer this question