Phương thức toán học Python.cos ()
Thí dụ
Tìm cosin của các số khác nhau:
# Import math Library
import math
# Return the cosine of
different numbers
print (math.cos(0.00))
print (math.cos(-1.23))
print (math.cos(10))
print (math.cos(3.14159265359))
Định nghĩa và Cách sử dụng
Phương math.cos()
thức trả về cosine của một số.
Cú pháp
math.cos(x)
Giá trị tham số
Parameter | Description |
---|---|
x | Required. A number to find the cosine of. If the value is not a number, it returns a TypeError |
Chi tiết kỹ thuật
Giá trị trả lại: | Một float giá trị, từ -1 đến 1, đại diện cho cosin của một góc |
---|---|
Phiên bản Python: | 1,4 |