MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / arc_length

Function arc_length

maths/arc_length.py:4–13  ·  view source on GitHub ↗

>>> arc_length(45, 5) 3.9269908169872414 >>> arc_length(120, 15) 31.415926535897928 >>> arc_length(90, 10) 15.707963267948966

(angle: int, radius: int)

Source from the content-addressed store, hash-verified

2
3
4def arc_length(angle: int, radius: int) -> float:
5 """
6 >>> arc_length(45, 5)
7 3.9269908169872414
8 >>> arc_length(120, 15)
9 31.415926535897928
10 >>> arc_length(90, 10)
11 15.707963267948966
12 """
13 return 2 * pi * radius * (angle / 360)
14
15
16if __name__ == "__main__":

Callers 1

arc_length.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected