-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsolution.java
More file actions
33 lines (33 loc) · 1.43 KB
/
solution.java
File metadata and controls
33 lines (33 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.util.*;
import java.io.*;
import java.lang.Math;
public class solution {
public static void main(String [] args) throws IOException{
Scanner i = new Scanner(new File("Trigonometry.dat"));
int count = i.nextInt();
for(int j = 0; j<count; j++){
int horizontal = i.nextInt();
int vertical = i.nextInt();
System.out.println("Horizontal side length = "+horizontal);
System.out.println();
System.out.println("Vertical side length = "+vertical);
System.out.println();
int hypotenuse = (int) (Math.sqrt(Math.pow(horizontal,2)+Math.pow(vertical,2)));
System.out.println("Hypotenuse length = "+hypotenuse);
System.out.println();
System.out.println("Sin x = "+vertical+"/"+hypotenuse);
System.out.println();
System.out.println("Cos x = "+horizontal+"/"+hypotenuse);
System.out.println();
System.out.println("Tan x = "+vertical+"/"+horizontal);
System.out.println();
System.out.println("Csc x = "+hypotenuse+"/"+vertical);
System.out.println();
System.out.println("Sec x = "+hypotenuse+"/"+horizontal);
System.out.println();
System.out.println("Cot x = "+horizontal+"/"+vertical);
System.out.println();
System.out.println();
}
}
}