Boopbot
|
  |
| Joined: 11 Jul 2008 |
| Total Posts: 2284 |
|
|
| 08 Jul 2011 03:51 PM |
| How can you do absolute value ([-20] = 20), and sine, cosine, and tangent? |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 03:53 PM |
math.abs = absolute value math.sin, math.cos, math.tan = sine, cosine, tan (respectively) math.asin, math.acos, math.atan = arcsin, arccos, arctan (respectively) |
|
|
| Report Abuse |
|
|
Boopbot
|
  |
| Joined: 11 Jul 2008 |
| Total Posts: 2284 |
|
|
| 08 Jul 2011 04:04 PM |
| So, if you have an opposite side and a hypotenuse, do you use arcsine to find the angle like this: math.arcsin(Opp/Hypo). I haven't used Trig in awhile. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:05 PM |
SOHCAHTOA Evaluate that. What would be using those for in Lua? |
|
|
| Report Abuse |
|
|
Boopbot
|
  |
| Joined: 11 Jul 2008 |
| Total Posts: 2284 |
|
|
| 08 Jul 2011 04:10 PM |
I know Sohcahtoa. Here, I need to find the angle.
This angle --\/ O---------------------------O --\--------------------------| ----\------------------------| ------\----------------------| --------\--------------------| --------- \------------------| ------------\----------------| --------------\--------------| ----------------\------------|I know this side --And this side--\----------| --------------------\--------| ----------------------\------| ------------------------\----| --------------------------\--| ----------------------------\| |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:12 PM |
| Hmmm. Won't that just be Sin? |
|
|
| Report Abuse |
|
|
Boopbot
|
  |
| Joined: 11 Jul 2008 |
| Total Posts: 2284 |
|
|
| 08 Jul 2011 04:13 PM |
| You need to learn Trig. Sine is used to find a side when you know the angle. Inverse sine is used to find the angle when you know the sides. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:14 PM |
| Oh nvm. Haven't use trigo in a long while. |
|
|
| Report Abuse |
|
|
Boopbot
|
  |
| Joined: 11 Jul 2008 |
| Total Posts: 2284 |
|
|
| 08 Jul 2011 04:24 PM |
| Well, Roblox sucks. I did sin(30) on a calculator and sin(30) on Roblox and Roblox was wrong. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:27 PM |
| Roblox takes radians, not degrees. :D |
|
|
| Report Abuse |
|
|
Boopbot
|
  |
| Joined: 11 Jul 2008 |
| Total Posts: 2284 |
|
|
| 08 Jul 2011 04:43 PM |
| Ok, then how can you translate it. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 04:44 PM |
math.rad(degrees) math.deg(radians) |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 05:18 PM |
You would use the arcsine to find the angle.
Angle = math.asin(O/H) print("Degrees: "..math.deg(Angle), "Radians: "..Angle)
|
|
|
| Report Abuse |
|
|
| |
|
Jinxy
|
  |
| Joined: 04 Aug 2007 |
| Total Posts: 18317 |
|
|
| 08 Jul 2011 05:51 PM |
| Are you trying to find the side of the triangle? If you know the Hypotenuse and one of the legs, then a^2+b^2=c^2, so you would subtract a^2 (or b^2) from c^2, and then get the square root of that. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 05:52 PM |
@Jinx
No, he knows the right side (i dunno the the term) and the hypotenuse, and he needs to find the angle. AFF did it |
|
|
| Report Abuse |
|
|
Jinxy
|
  |
| Joined: 04 Aug 2007 |
| Total Posts: 18317 |
|
|
| 08 Jul 2011 05:53 PM |
| He was looking for the angle? -_-;; |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 05:54 PM |
Well considering he said "Here, I need to find the angle."
...then yes. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 05:54 PM |
| Where is the Object Browser? |
|
|
| Report Abuse |
|
|
Jinxy
|
  |
| Joined: 04 Aug 2007 |
| Total Posts: 18317 |
|
|
| 08 Jul 2011 05:54 PM |
| I look back now, and I realize that's what he was looking for... .=. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 05:58 PM |
"Where is the Object Browser?"
Help > Object Browser |
|
|
| Report Abuse |
|
|