طريقة بايثون math.sin ()
مثال
أوجد جيب الأرقام المختلفة:
# Import math Library
import math
# Return the sine of different
values
print (math.sin(0.00))
print (math.sin(-1.23))
print (math.sin(10))
print (math.sin(math.pi))
print
(math.sin(math.pi/2))
التعريف والاستخدام
تقوم math.sin()
الطريقة بإرجاع جيب الرقم.
ملاحظة: للعثور على جيب الدرجات ، يجب أولاً تحويله إلى راديان باستخدام الطريقة (انظر المثال أدناه).
math.radians()
بناء الجملة
math.sin(x)
قيمه المعامل
Parameter | Description |
---|---|
x | Required. The number to find the sine of. If the value is not a number, it returns a TypeError |
تفاصيل تقنية
قيمة الإرجاع: | قيمة float ، من -1 إلى 1 ، تمثل جيب الزاوية |
---|---|
نسخة بايثون: | 1.4 |
مزيد من الأمثلة
مثال
أوجد جيب الدرجات المختلفة:
# Import math Library
import math
# Return the sine value of 30
degrees
print(math.sin(math.radians(30)))
# Return the sine value
of 90 degrees
print(math.sin(math.radians(90)))