DEV Community

Adam Crockett 🌀
Adam Crockett 🌀

Posted on

Calculate the length of the opposite of a right triangle

Hiya, I am trying to solve something but it's driving me mad, please save me, no this is not math homework I am 30 years old.

I have this triangle here:

Hypot = 60
Adjacent = 30
Opposite ??

lets give them nice names
Hypot = C
Adjacent = A
Opposite = B

I do not know the angles apart from that this is a right angle triangle.

What are the steps to solve this?

I am JavaScript centric so code in this language or explanations in code would be super! (math is not my strongest suit sometimes)

Top comments (4)

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

Perhaps Pythagoras theorem. google.com/search?q=hypotenuse

Collapse
 
hnicolas profile image
Nicolas Hervé • Edited

Pythagore : c*c = a*a + b*b

Collapse
 
adam_cyclones profile image
Adam Crockett 🌀

I think it's?
B = √(c² - a²)

Collapse
 
coolshaurya profile image
Shaurya • Edited

yep that's correct -
this gives us b = sqrt(3) * 30 upon further simplification which is approximately equal to - 51.962