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 » Scripters
Home Search
 

Re: Finding angle in a Right Triangle?

Previous Thread :: Next Thread 
Tedgary009 is not online. Tedgary009
Joined: 29 Dec 2009
Total Posts: 339
30 May 2016 12:51 PM
/(4,9)
/|
/ |
/ |
/ _|
/A_|_|
(0,1) (4,1)

How do I accomplish angle A?
(and no this is not for a math homework)
Report Abuse
iJacobness is not online. iJacobness
Joined: 20 Jan 2014
Total Posts: 4944
30 May 2016 12:52 PM
u have to get atleast 2 measurements


r+://393244197r+://393244224r+://393244262
Report Abuse
Tedgary009 is not online. Tedgary009
Joined: 29 Dec 2009
Total Posts: 339
30 May 2016 12:54 PM
Is it not possible with points? Because I'm trying to find the angle of a wedge
Report Abuse
Internecivus is not online. Internecivus
Joined: 31 May 2011
Total Posts: 2784
30 May 2016 12:59 PM
I'm assuming you want to automate this with a script? In that case you use Vector2s to find the lengths of the sides both adjacent and opposite to A

Apos = Vector2.new(0,1)
Bpos = Vector2.new(4,1)
Cpos = Vector2.new(4,9)

Now you want to find the lengths of AB and BC:
AB = (Bpos - Apos).magnitude
BC = (Cpos-Bpos).magnitude

Then you simply use math.atan on the opposite side divided by the adjacent side:

math.tan(BC/AB)

This gives you the angle in radians, if you want it in degrees:

math.deg(math.tan(BC/AB))

Let me know if I managed to fail at Grade 10 math somewhere along the line...
Report Abuse
Internecivus is not online. Internecivus
Joined: 31 May 2011
Total Posts: 2784
30 May 2016 01:01 PM
Annnd I made a dumb. I said to use atan then proceeded to use tan in my example. Atan is the correct one to use.
Report Abuse
Tedgary009 is not online. Tedgary009
Joined: 29 Dec 2009
Total Posts: 339
30 May 2016 01:03 PM
figured this out, over complicated some things on my part. Thanks for the attempt though. other method:

math.atan2(part.Size.Y, part.Size.Z)*(180/math.pi)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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