Python Math.degrees() Metoda
Przykład
Przelicz kąty z radianów na stopnie:
# Import math Library
import math
# Convert from radians to
degrees:
print (math.degrees(8.90))
print (math.degrees(-20))
print
(math.degrees(1))
print (math.degrees(90))
Definicja i użycie
Metoda mmath.degrees()
konwertuje kąt z radianów na stopnie.
Wskazówka: radiany PI (3.14..) są równe 180 stopni, co oznacza, że 1 radian to 57.2957795 stopni.
Wskazówka: Zobacz także math.radians()
, jak przekonwertować wartość w stopniach na radiany.
Składnia
math.degrees(x)
Wartości parametrów
Parameter | Description |
---|---|
x | Required. A radian value to convert into degrees. If the parameter is not a number, it returns a TypeError |
Szczegóły techniczne
Wartość zwrotu: | Wartość float reprezentująca wartość w stopniach |
---|---|
Wersja Pythona: | 2,3 |