fatiando / boule

Reference ellipsoids for geodesy and geophysics
https://www.fatiando.org/boule
BSD 3-Clause "New" or "Revised" License
38 stars 17 forks source link

Add TriaxialEllipsoid class with geometric parameters #72

Closed dabiged closed 2 years ago

dabiged commented 3 years ago

Skeleton class for a Triaxial Ellipsoid. I have implemented the basic framework and a number of properties from Issue #47 . More advanced methods raise a NotImplementedError. I have taken formula from wikipedia and this paper: https://www.sciencedirect.com/science/article/abs/pii/S0019103584711183?via%3Dihub

ToDo:

Submitting this Pull request early to get feedback.

Reminders:

dabiged commented 3 years ago

I would love some feedback on this before I go much further. Implementing things like a radius method, or anything more advanced seems to require elliptic integrals which I do not feel comfortable doing.

santisoler commented 3 years ago

I'm wondering if we can benefit from creating some inheritance, I mean make Ellipsoid a subclass of TriaxialEllipsoid. Even though from a mathematic perspective is true (any biaxial ellipsoid is a triaxial ellipsoid with one pair of axis of equal lenght), maybe it could not bring any advantage from a code design perspective.

cc @leouieda

leouieda commented 3 years ago

@santisoler @dabiged this is bringing up some interesting flaws in our current design. I’m usually hesitant to add a lot of inheritance. It’s rarely a good solution in my experience. Instead, see #76 for a proposal to have a single class. I think this would fix a lot of issues with methods taking unused arguments.

MarkWieczorek commented 3 years ago

I am ok with geocentric_radius, but at the same time, in spherical coordinates (r, theta, phi), r is "radius". Maybe geodesists aren't used to working with spherical coordinates, so having this be explicit is ok.

leouieda commented 2 years ago

Alright, I finished the few things left over from this PR. Removed all of the not implemented methods instead to simplify things. We can add them later when we have the need for such calculations.