Skip to content

Commit d80f3ed

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 26f8295 commit d80f3ed

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

maths/area.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ def surface_area_cone(radius: float, height: float) -> float:
134134
raise ValueError("surface_area_cone() only accepts non-negative values")
135135
return pi * radius * (radius + (height**2 + radius**2) ** 0.5)
136136

137+
137138
def lateral_surface_cone(radius: float, height: float) -> float:
138139
"""
139140
Calculate the Lateral Surface Area of a Cone.
@@ -157,8 +158,9 @@ def lateral_surface_cone(radius: float, height: float) -> float:
157158
"""
158159
if radius < 0 or height < 0:
159160
raise ValueError("lateral_surface_cone() only accepts non-negative values")
160-
return pi * radius * (height**2 + radius**2) ** 0.5
161-
161+
return pi * radius * (height**2 + radius**2) ** 0.5
162+
163+
162164
def surface_area_conical_frustum(
163165
radius_1: float, radius_2: float, height: float
164166
) -> float:
@@ -225,12 +227,13 @@ def surface_area_cylinder(radius: float, height: float) -> float:
225227
raise ValueError("surface_area_cylinder() only accepts non-negative values")
226228
return 2 * pi * radius * (height + radius)
227229

230+
228231
def lateral_surface_cylinder(radius: float, height: float) -> float:
229232
"""
230233
Calculate the Lateral Surface Area of a Cylinder.
231234
Wikipedia reference: https://en.wikipedia.org/wiki/Cylinder
232235
Formula: 2 * pi * r * h
233-
236+
234237
>>> lateral_surface_cylinder(10, 20)
235238
702.4814731040726
236239
>>> lateral_surface_cylinder(6, 8)
@@ -248,7 +251,8 @@ def lateral_surface_cylinder(radius: float, height: float) -> float:
248251
"""
249252
if radius < 0 or height < 0:
250253
raise ValueError("lateral_surface_cylinder() only accepts non-negative values")
251-
return 2 * pi * radius * height
254+
return 2 * pi * radius * height
255+
252256

253257
def surface_area_torus(torus_radius: float, tube_radius: float) -> float:
254258
"""Calculate the Area of a Torus.
@@ -632,4 +636,3 @@ def area_reg_polygon(sides: int, length: float) -> float:
632636
print(f"Equilateral Triangle: {area_reg_polygon(3, 10) = }")
633637
print(f"Square: {area_reg_polygon(4, 10) = }")
634638
print(f"Reqular Pentagon: {area_reg_polygon(5, 10) = }")
635-

0 commit comments

Comments
 (0)