Trig Ratios
View as PDF
Submit solution
Points:
3
Time limit:
2.0s
Memory limit:
64M
Author:
Problem type
Allowed languages
Java
Java implements the three basic trigonometry ratios as functions from the Math class. Each method takes an angle in radians and returns the value of the ratio. See the Math API to find a method to help convert degrees to radians. You can also convert manually using Math.PI/180.
Math.sin(double);
Math.cos(double);
Math.tan(double);

Given an angle in degrees, print the value of its sine, cosine and tangent.
Input
The input is an integer between and
representing the angle in degrees.
Output
Output the angle's sine, cosine and tangent each on a new line rounded to 2 decimal places. Do not print trailing zeroes. This means that instead of 0.50, you should output 0.5.
Sample Input
30
Sample Output
0.5
0.87
0.58
Comments