欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Python入門之三角函數(shù)tan()函數(shù)實(shí)例詳解

 更新時(shí)間:2017年11月08日 10:41:14   投稿:mengwei  
這篇文章主要介紹了Python入門之三角函數(shù)tan()的相關(guān)內(nèi)容,介紹了tan()函數(shù)的描述,語(yǔ)法以及簡(jiǎn)單實(shí)例,具有一定參考價(jià)值,需要的朋友可以了解下。

描述

tan() 返回x弧度的正弦值。

語(yǔ)法

以下是 tan() 方法的語(yǔ)法:

import math
math.tan(x)

注意:tan()是不能直接訪問(wèn)的,需要導(dǎo)入 math 模塊,然后通過(guò) math 靜態(tài)對(duì)象調(diào)用該方法。

參數(shù)

x -- 一個(gè)數(shù)值。

返回值

返回x弧度的正弦值,數(shù)值在 -1 到 1 之間。

實(shí)例

以下展示了使用 tan() 方法的實(shí)例:

#!/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)

以上實(shí)例運(yùn)行后輸出結(jié)果為:

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

總結(jié)

以上就是本文關(guān)于Python入門之三角函數(shù)tan()函數(shù)實(shí)例詳解的全部?jī)?nèi)容,希望對(duì)大家有所幫助。感興趣的朋友可以繼續(xù)參閱本站:Python入門之三角函數(shù)sin()函數(shù)實(shí)例詳解、Python入門之三角函數(shù)atan2()函數(shù)詳解、簡(jiǎn)單了解Python中的幾種函數(shù)等,有什么問(wèn)題可以隨時(shí)留言,小編會(huì)及時(shí)回復(fù)大家的。感謝朋友們對(duì)本站的支持!

相關(guān)文章

最新評(píng)論