Python math.acos()เมธอด
ตัวอย่าง
ส่งกลับค่าโคไซน์อาร์คของจำนวนต่างๆ:
# Import math Library
import math
# Return the arc cosine
of numbers
print(math.acos(0.55))
print(math.acos(-0.55))
print(math.acos(0))
print(math.acos(1))
print(math.acos(-1))
ความหมายและการใช้งาน
เมธอดส่งคืน ค่าmath.acos()
อาร์คโคไซน์ของตัวเลข
หมายเหตุ:พารามิเตอร์ที่ส่งผ่านmath.acos()
ต้องอยู่ระหว่าง -1 ถึง 1
เคล็ดลับ: math.acos(-1)
จะคืนค่าของ PI
ไวยากรณ์
math.acos(x)
ค่าพารามิเตอร์
Parameter | Description |
---|---|
x | Required. A number in the range -1 to 1. If x is not a number, it returns a TypeError |
รายละเอียดทางเทคนิค
คืนมูลค่า: | ค่า ที่float แทนค่าอาร์คโคไซน์ของตัวเลข |
---|---|
เวอร์ชันหลาม: | 1.4 |