I am pretty new to math and wanted to find out how to calculate the angle between the hypotenuse and the adjacent side, with only knowing the adjacent side and the abutting catheter.
I know that tan is abutting catheter divided by adjacent side. But that gives my a double.
How to I cast that number to degrees.
Here's my code:
import java.util.Scanner; public class Matte { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.println("Enter abutting catheter: "); double par1 = in.nextDouble(); System.out.println("Enter adjacent side: "); double par2 = in.nextDouble(); System.out.println("calculating..."); double deci = Math.tan(par1 / par2); System.out.println("The answer is: " + Double.toString(deci)); } }
Please help me!