Python math.tan() 方法
示例
查詢不同數字(弧度)的正切
# 匯入 math 庫
import math
# 返回不同數字的正切
print (math.tan(90))
print (math.tan(-90))
print (math.tan(45))
print (math.tan(60))
自己動手試一試 »
定義和用法
math.tan()
方法返回一個數字的正切。
語法
math.tan(x)
引數值
引數 | 描述 |
---|---|
x | 必需。一個用於求正切的數字。如果該值不是數字,則返回 TypeError |
技術詳情
返回值 | 一個 float 值,表示一個數字的正切。 |
---|---|
Python 版本 | 1.4 |