How to Calculate Trigonometric Sine of an Angle in Java


In this example, we will learn how to calculate trigonometric sine of an angle in Java.

Source Code

package com.beginner.examples;

public class SineExample {

    public static void main(String[] args){
    	//return the trigonometric sine value of an angle.
        System.out.println("sin(45) is: "+Math.sin(45));
        System.out.println("sin(60) is: "+Math.sin(60));
    }
}

Output:

sin(45) is: 0.8509035245341184
sin(60) is: -0.3048106211022167
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments