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 |