Java Program to Find the Trigonometric Sine of an Angle

You are currently viewing Java Program to Find the Trigonometric Sine of an Angle

Java program to find the trigonometric sine of an angle

// Java program to find the trigonometric sine 
// of an angle

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner X = new Scanner(System.in);

    double degree = 0;

    System.out.print("Enter value in degree: ");
    degree = X.nextDouble();

    double rad = Math.toRadians(degree);

    System.out.print("Trigonometric sine is: " + Math.sin(rad));
  }
}

Output

Enter value in degree: 30
Trigonometric sine is: 0.49999999999999994

Ranjith

Hi, I'm Manoj a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply