Метод 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, представляющее косинус угла. |
---|---|
Версия Python: | 1,4 |