python反三角函數(shù) Python反三角函數(shù)

如何用python表示三角函數(shù)

Python編碼下面的三角函數(shù)包括以下種類:acos(x)//返回x的反余弦弧度值。asin(x)//返回x的反正弦弧度值。atan(x)//返回x的反正切弧度值。atan2(y,x)//返回給定的X及Y坐標(biāo)值的反正切值。cos(x)//返回x的弧度的余弦值。hypot(x,y

網(wǎng)站建設(shè)哪家好,找成都創(chuàng)新互聯(lián)!專注于網(wǎng)頁設(shè)計(jì)、網(wǎng)站建設(shè)、微信開發(fā)、重慶小程序開發(fā)、集團(tuán)企業(yè)網(wǎng)站建設(shè)等服務(wù)項(xiàng)目。為回饋新老客戶創(chuàng)新互聯(lián)還提供了貢山免費(fèi)建站歡迎大家使用!

描述

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

語法

以下是sin()方法的語法:

importmath

math.sin(x)

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

參數(shù)

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

返回值

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

實(shí)例

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

#!/usr/bin/python

import math

print "sin(3) : ", math.sin(3)

print "sin(-3) : ", math.sin(-3)

print "sin(0) : ", math.sin(0)

print "sin(math.pi) : ", math.sin(math.pi)

print "sin(math.pi/2) : ", math.sin(math.pi/2)

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

sin(3) : 0.14112000806

sin(-3) : -0.14112000806

sin(0) : 0.0

sin(math.pi) : 1.22460635382e-16

sin(math.pi/2) : 1

總結(jié)

以上就是本文關(guān)于Python入門之三角函數(shù)sin()函數(shù)實(shí)例詳解的全部內(nèi)容,希望對大家有所幫助。感興趣的朋友可以繼續(xù)參閱本站:python正則表達(dá)式re之compile函數(shù)解析、Python中enumerate函數(shù)代碼解析、簡單了解Python中的幾種函數(shù)等,有什么問題可以隨時(shí)留言,小編會(huì)及時(shí)回復(fù)大家的。感謝朋友們對本站的支持!

python中 df.ACoS 是什么意思

說你聲明的這個(gè)df對象沒有ACoS屬性啊,具體怎么操作df對象你可以看一下這個(gè)資料網(wǎng)頁鏈接

python什么函數(shù)能求正切的反三角函數(shù)

atan()方法返回x的反正切值,以弧度表示。

Syntax

以下是atan()方法的語法:

atan(x)

注意:此函數(shù)是無法直接訪問的,所以我們需要導(dǎo)入math模塊,然后需要用math的靜態(tài)對象來調(diào)用這個(gè)函數(shù)。

參數(shù)

x -- 這必須是一個(gè)數(shù)值。

返回值

此方法返回 x 的反正切值,以弧度表示。

例子

下面的例子顯示atan()方法的使用。

#!/usr/bin/python

import math

print "atan(0.64) : ", math.atan(0.64)

print "atan(0) : ", math.atan(0)

print "atan(10) : ", math.atan(10)

print "atan(-1) : ", math.atan(-1)

print "atan(1) : ", math.atan(1)

當(dāng)我們運(yùn)行上面的程序,它會(huì)產(chǎn)生以下結(jié)果:

atan(0.64) : 0.569313191101

atan(0) : 0.0

atan(10) : 1.4711276743

atan(-1) : -0.785398163397

atan(1) : 0.785398163397

本文標(biāo)題:python反三角函數(shù) Python反三角函數(shù)
瀏覽路徑:http://muchs.cn/article18/hjsodp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供小程序開發(fā)、網(wǎng)站內(nèi)鏈搜索引擎優(yōu)化、建站公司、云服務(wù)器、標(biāo)簽優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

手機(jī)網(wǎng)站建設(shè)