bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/Java/Java Reference
Java•Java Reference

Java Math sin() Method

❮ Math Methods

Example

System.out.println(Math.sin(3));
System.out.println(Math.sin(-3));
System.out.println(Math.sin(0));
System.out.println(Math.sin(Math.PI));
System.out.println(Math.sin(Math.PI/2));

Definition and Usage

The sin() method returns the sine of an angle.

Note

Angles are measured in radians.

Tip

You can use the constant Math.PI to make fractions of PI for angles.

Syntax

public static double sin(double
angle )

Parameter Values

ParameterDescription
angleRequired. An angle in radians to find the sine of.

Technical Details

Returns:A double value representing the sine of an angle.
Java version:Any

Previous

Java Math signum() Method

Next

Java Math sinh() Method