mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-30 16:31:08 +00:00
16 lines
290 B
Python
16 lines
290 B
Python
|
from math import pi
|
||
|
|
||
|
|
||
|
def arc_length(angle: int, radius: int) -> float:
|
||
|
"""
|
||
|
>>> arc_length(45, 5)
|
||
|
3.9269908169872414
|
||
|
>>> arc_length(120, 15)
|
||
|
31.415926535897928
|
||
|
"""
|
||
|
return 2 * pi * radius * (angle / 360)
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
print(arc_length(90, 10))
|