MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / radians

Function radians

maths/radians.py:4–23  ·  view source on GitHub ↗

Converts the given angle from degrees to radians https://en.wikipedia.org/wiki/Radian >>> radians(180) 3.141592653589793 >>> radians(92) 1.6057029118347832 >>> radians(274) 4.782202150464463 >>> radians(109.82) 1.9167205845401725 >>> from math import ra

(degree: float)

Source from the content-addressed store, hash-verified

2
3
4def radians(degree: float) -> float:
5 """
6 Converts the given angle from degrees to radians
7 https://en.wikipedia.org/wiki/Radian
8
9 >>> radians(180)
10 3.141592653589793
11 >>> radians(92)
12 1.6057029118347832
13 >>> radians(274)
14 4.782202150464463
15 >>> radians(109.82)
16 1.9167205845401725
17
18 >>> from math import radians as math_radians
19 >>> all(abs(radians(i) - math_radians(i)) <= 1e-8 for i in range(-2, 361))
20 True
21 """
22
23 return degree / (180 / pi)
24
25
26if __name__ == "__main__":

Callers 4

haversine_distanceFunction · 0.90
sinFunction · 0.90
polar_forceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected