python 弧度與角度互轉(zhuǎn)實(shí)例
我就廢話(huà)不多說(shuō)了,還是直接看代碼吧!
import mathdef deal(yaw): if(yaw<0):print(-(abs(yaw)/math.pi)*180)print(math.degrees(yaw)) else:print((abs(yaw)/math.pi)*180)print(math.degrees(yaw))yaw=math.pi/6deal(yaw)yaw=-math.pi/3deal(yaw)
輸出
30.029.999999999999996-60.0-59.99999999999999
補(bǔ)充知識(shí):MATLAB中角度轉(zhuǎn)換成弧度函數(shù)——degtorad
degtorad
Convert angles from degrees to radians
將角度從度數(shù)轉(zhuǎn)換為弧度
Syntax:angleInRadians = degtorad(angleInDegrees)
語(yǔ)法:弧度 = degtorad(角度)
Description
angleInRadians = degtorad(angleInDegrees) converts angle units from degrees to radians. This is both an angle conversion function and a distance conversion function, since arc length can be a measure of distance in either radians or degrees, provided that the radius is known.
描述:angleInRadians = degtorad(angleInDegrees)將角度單位從度數(shù)轉(zhuǎn)換為弧度。這是角度轉(zhuǎn)換函數(shù)和距離轉(zhuǎn)換函數(shù),因?yàn)榛¢L(zhǎng)可以是弧度或度數(shù)的距離的度量,只要半徑是已知的。
Examples
Show that there are 2π radians in a full circle:2*pi - degtorad(360)ans = 0
例子
顯示整個(gè)圓圈內(nèi)有2π弧度:
以上這篇python 弧度與角度互轉(zhuǎn)實(shí)例就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持好吧啦網(wǎng)。
相關(guān)文章:
1. ajax實(shí)現(xiàn)省市三級(jí)聯(lián)動(dòng)效果2. 利用CSS3新特性創(chuàng)建透明邊框三角3. 如何利用Ajax實(shí)現(xiàn)地區(qū)三級(jí)聯(lián)動(dòng)詳解4. 5個(gè)HTML5的常用本地存儲(chǔ)方式詳解與介紹5. 通過(guò)CSS實(shí)現(xiàn)逼真水滴動(dòng)效6. 使用Spry輕松將XML數(shù)據(jù)顯示到HTML頁(yè)的方法7. 利用單元測(cè)試對(duì)PHP代碼進(jìn)行檢查8. 利用FastReport傳遞圖片參數(shù)在報(bào)表上展示簽名信息的實(shí)現(xiàn)方法9. layui的checbox在A(yíng)jax局部刷新下的設(shè)置方法10. Spring注入Date類(lèi)型的三種方法總結(jié)
