Python Math.radians() Metoda
Przykład
Zamień różne stopnie na radiany:
# Import math Library
import math
# Convert different degrees
into radians
print(math.radians(180))
print(math.radians(100.03))
print(math.radians(-20))
Definicja i użycie
Metoda math.radians()
konwertuje wartość w stopniach na radiany.
Wskazówka: Zobacz także math.degrees()
, jak przekonwertować kąt z radianów na stopnie.
Składnia
math.radians(x)
Wartości parametrów
Parameter | Description |
---|---|
x | Required. The degree value to be converted into radians. If the parameter is not a number, it returns a TypeError |
Szczegóły techniczne
Wartość zwrotu: | Wartość float reprezentująca wartość kąta w radianach |
---|---|
Wersja Pythona: | 2,0 |