Hey all, I'll just get straight to it, when I input a vertical height of 4 and a top angle of 30 (in degrees) I get ridiculous answers,
for example, the ladder length should be 5, and the floor length should be 3 (a 3, 4, 5 triangle) but I get huge decimal answers and can't figure out why.
Here is the code of the class containing the main method and scanner
And this is the code of the calculations etc
My other, generic, question is about the constructor and the print statements at the end of the User class. Do I have to assign values to things such as bottomAngle, floorLength etc in the constructor, and then use +bottomAngle in the println statements?
Or is there a way I can use getBottomAngle() and call the "local variable" (is that the right term)??
Thanks for all your help so far guys.
The reason I'm not sure what the problem is, is because it is clearly not giving me the answer as if I had done cosine, sine, or tangent of the input angle in radians, I have checked on my calculator and I've no idea where these values are coming from!!
for example, the ladder length should be 5, and the floor length should be 3 (a 3, 4, 5 triangle) but I get huge decimal answers and can't figure out why.
Here is the code of the class containing the main method and scanner
And this is the code of the calculations etc
My other, generic, question is about the constructor and the print statements at the end of the User class. Do I have to assign values to things such as bottomAngle, floorLength etc in the constructor, and then use +bottomAngle in the println statements?
Or is there a way I can use getBottomAngle() and call the "local variable" (is that the right term)??
Thanks for all your help so far guys.
The reason I'm not sure what the problem is, is because it is clearly not giving me the answer as if I had done cosine, sine, or tangent of the input angle in radians, I have checked on my calculator and I've no idea where these values are coming from!!