English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Java Math mathematical methods
La méthode toRadians () de Math Java convertit l'angle spécifié en radians.
The syntax of the toRadians() method is:
Math.toRadians(double angle)
Note: toRadians() is a static method. Therefore, we can use the class name Math to access this method.
angle - The angle to be converted to radians
Return the angle in radians
Note: The conversion from degrees to radians is approximate. However, it is usually not precise.
class Main { public static void main(String[] args) { //Create a variable double angle1 = 30.0; double angle2 = 45.0; System.out.println(Math.toRadians(angle1)); // 0.5235987755982988 System.out.println(Math.toRadians(angle2)); // 0.7853981633974483 } }