发布时间:2022-05-26 09:41:54 人气:236 作者:多测师
python中的三角函数在python的标准库math中,math已经包含在你的标准python包中,不需要单独安装。
下面我们就来看一下python中使用三角函数的方法:
如果要求tan(1)的反函数,可用如下方法:
import math
math.atan(1)*180/(math.pi)
如果要求sin(1)和cos(1)的反函数,可用如下方法:
import math
math.asin(1)*180/(math.pi)
math.acos(1)*180/(math.pi)
如果求tan函数的值
import math
print (math.tan(math.pi/4))
输出pi
import
print (math.pi)
以上内容为大家介绍了python的三角函数在哪?希望对大家有所帮助,如果想要了解更多Python相关知识,请关注多测师。https://www.e70w.com/xwzx/