国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術(shù)文章
文章詳情頁

python 弧度與角度互轉(zhuǎn)實例

瀏覽:2日期:2022-07-29 18:38:22

我就廢話不多說了,還是直接看代碼吧!

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ǔ)充知識:MATLAB中角度轉(zhuǎn)換成弧度函數(shù)——degtorad

degtorad

Convert angles from degrees to radians

將角度從度數(shù)轉(zhuǎn)換為弧度

Syntax:angleInRadians = degtorad(angleInDegrees)

語法:弧度 = 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ù),因為弧長可以是弧度或度數(shù)的距離的度量,只要半徑是已知的。

Examples

Show that there are 2π radians in a full circle:2*pi - degtorad(360)ans = 0

例子

顯示整個圓圈內(nèi)有2π弧度:

python 弧度與角度互轉(zhuǎn)實例

以上這篇python 弧度與角度互轉(zhuǎn)實例就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持好吧啦網(wǎng)。

標(biāo)簽: Python 編程
相關(guān)文章:
主站蜘蛛池模板: 刚察县| 邹城市| 溧阳市| 云浮市| 汉沽区| 肥西县| 醴陵市| 沁阳市| 潮州市| 郯城县| 惠东县| 淮滨县| 金湖县| 木里| 扎兰屯市| 博客| 博湖县| 新宁县| 那曲县| 察雅县| 双流县| 遂川县| 秦安县| 岳阳县| 临夏县| 涡阳县| 华容县| 罗城| 丽水市| 和顺县| 桐梓县| 南郑县| 和林格尔县| 萍乡市| 新和县| 浏阳市| 聂拉木县| 陆川县| 当涂县| 金湖县| 徐闻县|