Python math.cos()เมธอด
ตัวอย่าง
ค้นหาโคไซน์ของจำนวนต่างๆ:
# 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))
ความหมายและการใช้งาน
math.cos()
เมธอดจะคืนค่าโคไซน์ของตัวเลข
ไวยากรณ์
math.cos(x)
ค่าพารามิเตอร์
Parameter | Description |
---|---|
x | Required. A number to find the cosine of. If the value is not a number, it returns a TypeError |
รายละเอียดทางเทคนิค
คืนมูลค่า: | ค่าfloat ตั้งแต่ -1 ถึง 1 แทนโคไซน์ของมุม |
---|---|
เวอร์ชันหลาม: | 1.4 |