File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ def from_radians(cls, radians: float) -> Angle:
5353@dataclass
5454class Side :
5555 """
56- A side of a two dimensional Shape such as Polygon, etc.
56+ A side of a two- dimensional shape such as Polygon, etc.
5757 adjacent_sides: a list of sides which are adjacent to the current side
5858 angle: the angle in degrees between each adjacent side
5959 length: the length of the current side in meters
@@ -118,14 +118,15 @@ def area(self) -> float:
118118 @property
119119 def perimeter (self ) -> float :
120120 """
121+ Use Ramanujan's first approximation for ellipse perimeter.
122+ https://en.wikipedia.org/wiki/Perimeter_of_an_ellipse#First_approximation
123+
121124 >>> Ellipse(5, 10).perimeter
122125 48.44210548835644
123126 >>> Ellipse(1, 10).perimeter
124- 48.44210548835644
127+ 40.60552518514097
125128 """
126129 a , b = self .major_radius , self .minor_radius
127- # Use Ramanujan's first approximation for ellipse perimeter
128- # https://en.wikipedia.org/wiki/Perimeter_of_an_ellipse#First_approximation
129130 return math .pi * (3 * (a + b ) - ((3 * a + b ) * (a + 3 * b )) ** 0.5 )
130131
131132 @property
You can’t perform that action at this time.
0 commit comments