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
11 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))