# Java StrictMath toRadians() Method with Example

StrictMath Class toRadians() method: Here, we are going to learn about the toRadians() method of StrictMath Class with its syntax and example.
Submitted by Preeti Jain, on December 27, 2019

• toRadians() method is available in java.lang package.
• toRadians() method is used to convert the angle from degrees to radians or in other words this method is used to convert an angle measured in degrees to an equivalent angle measured in radians.
• toRadians() method is a static method so it is accessible with the class name and if we try to access the method with the class object then we will not get any error.
• toRadians() method does not throw any exception at the time of conversion of an angle from degree to radians.
• The result of conversion an angle from degrees to radians is not generally exact.

Syntax:

```    public static double toRadians(double ang_in_deg);
```

Parameter(s):

• double ang_in_deg – represents an angle in degrees.

Return value:

The return type of this method is double – it returns the radians converted value of the given angle (in degrees).

Example:

```// Java program to demonstrate the example of
// toRadians(double ang_in_deg) method of StrictMath class.

public static void main(String[] args) {

// Variable Declarations
double d1 = 60;
double d2 = -60;
double d3 = 90;
double d4 = -90;

// Display previous value of d1,d2,d3 and d4
System.out.println("d1: " + d1);
System.out.println("d2: " + d2);
System.out.println("d3: " + d3);
System.out.println("d4: " + d4);

// By using toRadians() method is used to convert the given angle

}
}
```

Output

```d1: 60.0
d2: -60.0
d3: 90.0
d4: -90.0
```

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates