Home >>Java Math Methods >Java Math.sin() method
The Math.sin() method in Java Math is used to return the angle sine in trigonometry. This method returns the value between -1 to 1.
public static double sin(double a)
a = This parameter is used for an angle, in radians
It is used to returns the sine value of the argument.
public class MyClass
{
public static void main(String[] args)
{
double x = 20;
double y = Math.toRadians(x);
System.out.println(Math.sin(y));
}
}
public class MyClass
{
public static void main(String[] args)
{
double x = 45;
double y = Math.toRadians(x);
System.out.println(Math.sin(y));
}
}