We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f681f44 commit d562bdcCopy full SHA for d562bdc
geometry/geometry.py
@@ -103,10 +103,11 @@ def area(self) -> float:
103
def perimeter(self) -> float:
104
"""
105
>>> Ellipse(5, 10).perimeter
106
- 48.44222344723793
+ 48.44210548835644
107
108
a, b = self.major_radius, self.minor_radius
109
- # uses ramanujans approximation
+ # Use Ramanujan's first approximation for ellipse perimeter
110
+ # https://en.wikipedia.org/wiki/Perimeter_of_an_ellipse#First_approximation
111
return math.pi * (3 * (a + b) - ((3 * a + b) * (a + 3 * b)) ** 0.5)
112
113
0 commit comments