Finding Angle in SSS Triangle JAVA

I need help calculating the angle between the 5 and the 3. I have absolutely no idea how to even model the question, let alone convert it to java. This is entirely specific, does not need to be abstracted.

int a=3; int b=4; int c=5; 

is honestly as far as I can get. This would be cos(b), right? I just need a quick pointer/solution

1

1 Answer

Is this a right-triangle? So the 5 is the hypotenuse (the side opposite the right angle)?

If that's the case, you need to find any one of the following (which should all be equal to each other): arctan(4/3), ArcSin(4/5), or arccos(3/5).

For example, using the first:

Math.toDegrees(Math.atan(4.0/3.0)) 

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like