## Java Math Class

Java Math class provides several methods to perform several operations on math calculations like max(), min(), sin(), cos(), round(), ceil(), floor(), abs() etc.
The java.lang.Math class contains various methods for performing basic numeric operations

Here, in the page we will discuss about the math toRadains() Method in java.

## Java Math toRadains() Method :

In Java, the Math.toRadians(double angdeg) method converts an angle in degrees to an approximately equivalent angle in radians.

The method takes a single parameter, angdeg, which is the angle in degrees. It returns a double value representing the angle in radians.Here’s an example of syntax how to use the toRadians() method:

### Syntax  :

`public static double toRadians(double angdeg)`

### Example 1 :

Run
```public class Main{
public static void main(String[] args) {
// Declare three angles in degrees
double angle1 = 30.0;
double angle2 = 60.0;
double angle3 = 90.0;

// Print the results to the console
}
}

```

### Output :

```0.5235987755982988
1.0471975511965976
1.5707963267948966
```

### Example 2:

Run
```public class Main {
public static void main(String[] args) {
// Declare four angles in degrees
double angle1 = 0.0;
double angle2 = 45.0;
double angle3 = 180.0;
double angle4 = 270.0;

// Print the results to the console
}
}

```

### Output :

```0.0
0.7853981633974483
3.141592653589793
4.71238898038469
```

### Related Banners

Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription

## Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others