diff --git a/src/geometry/sphere.py b/src/geometry/sphere.py index 47a5e7c..fdf2e85 100644 --- a/src/geometry/sphere.py +++ b/src/geometry/sphere.py @@ -1,13 +1,13 @@ from math import pi -def calculate_surface_area(r): +def calculate_volume(r): """ - Calculate the surface area of a sphere. + Calculate the volume of a sphere. This uses the standard mathematical calculation: - $4\pi r ^2$ + $(4 * \pi r ^3) / 3$ Parameters ---------- @@ -15,6 +15,21 @@ def calculate_surface_area(r): Returns ------- + float : the volume of the sphere + """ + + volume = (4 * pi * r **3) / 3 + return volume + + +def calculate_surface_area(r): + """ + Calculate the surface area of a sphere. + + This uses the standard mathematical calculation: + + $4\pi r ^2$ + float : the surface area of the sphere """ surface_area = 4 * pi * r **2