Java Math sin() Method

Facebooktwitterredditpinterestlinkedinmailby feather

The sin() method of Java Math class returns the trigonometric sine of the specified angle.

Syntax:

public static double sin(double a)

Parameters:

The parameter ‘a’ represents an angle measured in radians.

Return Value:

The sin() method returns the sine of the argument.

  • It returns zero with same sign as argument, if the argument passed is zero.
  • It returns NaN, if the argument is NaN or infinity.

Example 1:

 Output:

Example 2:

Output:

Example 3:

Output:

Example 4:

Output:

Example 5:

Output:

Facebooktwitterredditpinterestlinkedinmailby feather