Latest web development tutorials

Pythonの日焼け()関数

Pythonの数値 Pythonの数値


説明

日焼け()のxラジアンの正弦を返します。


文法

次の構文日焼け()メソッドです。

import math

math.tan(x)

注:日焼け()は直接アクセスできません、あなたは数学のモジュールをインポートする必要があり、その後、数学静的オブジェクトによってメソッドを呼び出します。


パラメータ

  • X - 値。

戻り値

-1から1の間の値は、ラジアンでxの正弦を返します。


以下は、黄褐色()メソッド例の使用方法を示しています。

#!/usr/bin/python
import math

print "tan(3) : ",  math.tan(3)
print "tan(-3) : ",  math.tan(-3)
print "tan(0) : ",  math.tan(0)
print "tan(math.pi) : ",  math.tan(math.pi)
print "tan(math.pi/2) : ",  math.tan(math.pi/2)
print "tan(math.pi/4) : ",  math.tan(math.pi/4)

上の例の出力を実行した後です。

tan(3) :  -0.142546543074
tan(-3) :  0.142546543074
tan(0) :  0.0
tan(math.pi) :  -1.22460635382e-16
tan(math.pi/2) :  1.63317787284e+16
tan(math.pi/4) :  1.0

Pythonの数値 Pythonの数値