generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: What are these math functions?

Previous Thread :: Next Thread 
Boopbot is not online. 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
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
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 is not online. 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
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
08 Jul 2011 04:05 PM
SOHCAHTOA
Evaluate that. What would be using those for in Lua?
Report Abuse
Boopbot is not online. 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
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
08 Jul 2011 04:12 PM
Hmmm. Won't that just be Sin?
Report Abuse
Boopbot is not online. 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
citymaster22 is not online. citymaster22
Joined: 10 Jan 2010
Total Posts: 4993
08 Jul 2011 04:14 PM
Oh nvm. Haven't use trigo in a long while.
Report Abuse
Boopbot is not online. 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
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
08 Jul 2011 04:27 PM
Roblox takes radians, not degrees. :D
Report Abuse
Boopbot is not online. Boopbot
Joined: 11 Jul 2008
Total Posts: 2284
08 Jul 2011 04:43 PM
Ok, then how can you translate it.
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
08 Jul 2011 04:44 PM
math.rad(degrees)
math.deg(radians)
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
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
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
08 Jul 2011 05:48 PM
@AFF

Hai
Report Abuse
Jinxy is not online. 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
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
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 is not online. Jinxy
Joined: 04 Aug 2007
Total Posts: 18317
08 Jul 2011 05:53 PM
He was looking for the angle? -_-;;
Report Abuse
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
08 Jul 2011 05:54 PM
Well considering he said "Here, I need to find the angle."

...then yes.
Report Abuse
twingotbanned is not online. twingotbanned
Joined: 25 Nov 2009
Total Posts: 12
08 Jul 2011 05:54 PM
Where is the Object Browser?
Report Abuse
Jinxy is not online. 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
DrAgonmoray is not online. DrAgonmoray
Joined: 29 Jul 2008
Total Posts: 17428
08 Jul 2011 05:58 PM
"Where is the Object Browser?"

Help > Object Browser
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image