Curriculum
Course: Java Basic
Login

Curriculum

Java Basic

Java Home

0/1

Java Introduction

0/1

Java Get Started

0/1

Java Syntax

0/1

Java Comments

0/1

Java Type Casting

0/1

Java Operators

0/1

Java Booleans

0/1

Java Switch

0/1

Java Break / Continue

0/1

Java Errors and Exception

0/1
Text lesson

sin()

Example

Provide the sine values for various angles.

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 computes the sine value of an angle.

Note: Angles are measured in radians.

Tip: Utilize the constant Math.PI to express angles as fractions of π.

Syntax

public static double sin(double angle)

Parameter Values

Parameter

Description

angle

“Necessary. An angle in radians for which the sine needs to be calculated.”

Technical Details

Returns:

“A double value indicating the sine of an angle.”

Java Version:

Any