## How to used Trigonometric function in java with example

Math class method is used for Trigonometric function in java. Trigonometric function like cosine, sine hyperbolic sine, arc sine can be used in java using math class methods

Syntax:-

Math.method(Variable)

method can be replaced by any Trigonometric function

List Trigonometric function used in java

 Method Operation Datatype used Math.sin(variable) sine Double Math.cos(variable) cosine Double Math.tan(variable) tan Double Math.sinh(variable) hyperbolic sine Double Math.cosh(variable) hyperbolic cosin Double Math.tanh(variable) hyperbolic tan Double Math.asin(variable) arc sine Double Math.acos(variable) arc cosine Double Math.atan(variable) arc tan Double

Convert radians to degrees in java

Syntax:-

toDegrees(variable)

toDegrees Converts an angle measured in radians to an approximately equivalent angle measured in degrees.

Convert degrees to radians in java

Syntax:-

Converts an angle measured in degrees to an approximately equivalent angle measured in radians.

Example:-

import java.util.Scanner;

class group{
public static void main(String angt[]){
Scanner data = new Scanner(System.in);
double num,num1;
System.out.println("Enter a number");
num1=data.nextDouble();

num=Math.cos(num1);

num=Math.sinh(num1);

num=Math.atan(num1);
num=Math.toDegrees(num1);

}
}

Output:-

Enter a number
2

Previous Code:-
Logarithm function in java

List Code:-
Java codes

Next Code:-

Java Programs:-
List of Java Programs

1. 2. You shared very useful post. Thanks for sharing.

html training in chennai

3. Great Blog.......

Buzz For Android

4. careful voice reaction, is a what blessings telephone structures to process touch tones or voice waves amidst a phone call.

ivr software

5. Nice blog. Thanks for sharing such a useful post.

Wordpress development services in chennai

6. It’s always so sweet and also full of a lot of fun for me personally and my office colleagues to search your blog a minimum of thrice in a week to see the new guidance you have got.
java training in bangalore 