diff --git a/boule/_ellipsoid.py b/boule/_ellipsoid.py index 33188758..37520222 100644 --- a/boule/_ellipsoid.py +++ b/boule/_ellipsoid.py @@ -101,6 +101,8 @@ class Ellipsoid: 8.2094437949696e-02 >>> print(f"{ellipsoid.mean_radius:.4f} m") 6371008.7714 m + >>> print(f"{ellipsoid.volume * 1e-9:.5e} km³") + 1.08321e+12 km³ >>> print(f"{ellipsoid.gravity_equator:.10f} m/s²") 9.7803253359 m/s² >>> print(f"{ellipsoid.gravity_pole:.10f} m/s²") @@ -217,6 +219,15 @@ def mean_radius(self): """ return 1 / 3 * (2 * self.semimajor_axis + self.semiminor_axis) + @property + def volume(self): + r""" + The volume bounded by the ellipsoid. + Definition: :math:`V = \dfrac{4}{3} \pi a^2 c`. + Units: :math:`m^3`. + """ + return (4 / 3 * np.pi) * self.semimajor_axis**2 * self.semiminor_axis + @property def _emm(self): "Auxiliary quantity used to calculate gravity at the pole and equator"