-
Notifications
You must be signed in to change notification settings - Fork 86
Rotate ellipsoids in create_ellipsoid based on semiaxes order
#613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Make the `create_ellipsoid` function to rotate the ellipsoid 90 degrees on the right angles when semiaxes lengths are provided in arbitrary order. An ellipsoid defined by `a`, `b`, `c` with no initial rotation angles passed to the function will be oriented so its semiaxes match with x, y, z directions. Any rotation angles passed to the function will be added to those 90 degrees ones.
create_ellipsoidcreate_ellipsoid when semiaxes are passed in different order
create_ellipsoid when semiaxes are passed in different ordercreate_ellipsoid based on semiaxes order
|
@santisoler Is there an explicit need to do either? Isn't there also: Option 0: Construct directly without sorting or rotatingwhere When we create an ellipsoid we specify the major axis length (a), and then the other axes are defined as ratios (b/a and c/b) such that we always know they are sorted and decreasing in size. |
|
That's a good point. From the point of view of the definition of the ellipsoid itself, it wouldn't be a problem to define them like that. The tricky part comes with the analytic solutions for the gravity and magnetic fields. The equations are usually written in terms of specific definitions for the ellipsoids:
We decided to enforce these conditions in the ellipsoid classes, so the forward modelling functions don't have to sort out ordering of the semiaxes plus apply the (extra) required rotations. One minor detail I haven't explicitly mentioned. The These definitions have a few other benefits. Like reducing the multiple definitions of ellipsoids. For example, any prolate ellipsoid with a->east, b->north, c->upward with constant ProlateEllipsoid(a, b, c, yaw=180*n, pitch=90*m, ...)with any If we allow passing ProlateEllipsoid(c, b, a, yaw=0, pitch=0, ...)
ProlateEllipsoid(a, b, c, yaw=0, pitch=90, ...)Moreover, by sticking with those definitions we know beforehand which angles will generate invariant rotations for the oblate and prolate (roll in both cases). And that helps to simplify the interface for them: the prolate and oblate have always
With option 2, the obtained ellipsoid will have a->easting, b-> northing, c->upward, regardless the ordering of Option 3: Redesign?Another alternative is to ditch the multiple ellipsoid classes and keep only an With such object, we won't even need the |
|
I started drafting the Option 3 in #616. I have to say that I like it better than having three ellipsoid classes + a factory function so far. A single class introduces some degeneracy, but I think the interface is much better with it. |



Make the
create_ellipsoidfunction to rotate the ellipsoid 90 degrees on the right angles when semiaxes lengths are provided in arbitrary order. An ellipsoid defined bya,b,cwith no initial rotation angles passed to the function will be oriented so its semiaxes match with easting, norting, upward directions. Any rotation angles passed to the function will be added to those 90 degrees ones.Relevant issues/PRs:
Part of #594