Logo
Explore Help
Register Sign In
TheAlgorithms/Python
1
0
Fork 0
You've already forked Python
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
00fc53de9709648b495ecf707549d6068592fb76
Python/maths/arc_length.py

16 lines
290 B
Python
Raw Normal View History

Arc Length Algorithm (#7610) * Create decimal_conversions.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Create arc_length.py * Delete decimal_conversions.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Removed redundant statement, fixed line overflow * Update arc_length.py Changed rad to radius as not to get confused with radians * Update arc_length.py * Update arc_length.py Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Chris O <46587501+ChrisO345@users.noreply.github.com>
2022-10-25 12:47:52 -07:00
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))
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 89ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API