diff --git a/boule/_sphere.py b/boule/_sphere.py index dcfd5c69..462a1b04 100644 --- a/boule/_sphere.py +++ b/boule/_sphere.py @@ -97,6 +97,8 @@ class Sphere: 0 >>> print(sphere.thirdflattening) 0 + >>> print(f"{sphere.volume:.10f} m³") + 4.1887902048 m³ """ @@ -174,6 +176,15 @@ def first_eccentricity(self): """ return 0 + @property + def volume(self): + r""" + The volume of the sphere. + Definition: :math:`V = \dfrac{4}{3} \pi r^3`. + Units: :math:`m^3`. + """ + return (4 / 3 * np.pi) * self.radius**3 + def normal_gravity(self, latitude, height, si_units=False): r""" Normal gravity of the sphere at the given latitude and height.