Phương thức toán học Python.degrees ()
Thí dụ
Chuyển đổi góc từ radian sang độ:
# 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))
Định nghĩa và Cách sử dụng
Phương mmath.degrees()
pháp chuyển đổi một góc từ radian sang độ.
Mẹo: PI (3,14 ..) radian bằng 180 độ, có nghĩa là 1 radian bằng 57,2957795 độ.
Mẹo: Xem thêm math.radians()
để chuyển đổi giá trị độ thành radian.
Cú pháp
math.degrees(x)
Giá trị tham số
Parameter | Description |
---|---|
x | Required. A radian value to convert into degrees. If the parameter is not a number, it returns a TypeError |
Chi tiết kỹ thuật
Giá trị trả lại: | Một float giá trị, đại diện cho giá trị bằng độ |
---|---|
Phiên bản Python: | 2.3 |