程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Cloud computing development: Python3 trigonometric function radians() method detailed

編輯:Python

Description

The Python3 radians() method converts angles to radians.

The relationship between angles and radians is: 2π radians = 360°.Thus 1°≈0.0174533 radians, and 1 radian ≈57.29578°.

1) The formula for converting an angle to a radian: radian=angle÷180×π

2) The formula for converting radians to angles: Angle = radians × 180÷π

Syntax

The following is the syntax of the radians() method:

import math

math.radians(x)

Note: radians() cannot be accessed directly, you need to import the math module, and then call this method through the math static object.

Parameters

x -- an angle value, the default unit is angle °.

Return value

Returns an angle in radians.

Instance

The following shows an example of using the radians() method:

The output result after running the above example is:


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved