-
Notifications
You must be signed in to change notification settings - Fork 407
Drawing ellipses on a sphere #5318
-
In fixing various issues in project -Z related to ellipses I started to read more about how to draw ellipses on a spherical surface. What does it mean if we want to plot an ellipse at some point with a given azimuth and two semi-axes? Normally, ellipses are drawn on flat surfaces. How does that translate to a sphere (never mind an ellipsoid)? GMT plots ellipses, and it does it using this scheme in the gmt_get_geo_ellipse function:
- Internally, create an azimuthal equal-area projection centered on the ellipse location so distances are in meters.
- Compute coordinates for the ellipse in the projected meters, then inverse project them back to lon, lat.
- Plot the lon,lat polygon using the actual map projection chosen.
Some googling lead me to this page which I first coded up quickly in Matlab, then implemented in gmt_get_geo_ellipse in the branch better-sphere-ellipse. Basically, they assert that the surface ellipse shall be the intersection of a conical elliptical surface and the sphere. The equations thus gives the Cartesian (x,y,z) of that intersection.
A handful of GMT tests that draw ellipses fail with the different algorithm; these are just tiny differences and I expected that the map projection solution is just slightly more approximate than the real thing. However, if we push this to the extreme and plot an ellipse that has a major axis of almost 180 degrees (here 170 x 90 degrees) it is starting to look quite different.
First, here is GMT 6.2.0 rendition of this ellipse:
Next is the cone/sphere intersection in the branch:
If I push more towards 180 then it starts to look more and more like an "eye", and it becomes slower - not sure why yet. I guess I am accustomed to what we always have had, but I confess I do not really know what is the correct answer here for such large elliptical areas on a sphere. What we have is clearly a Cartesian flat-Earth approximation of sorts, while the new solution appears to be an exact intersection - if that is what we want.
Open to comments on this from the whole @GenericMappingTools/pygmt-admin.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 3 comments 1 reply
-
Other googling avenues finds sites like this and when coding that up in branch better-sphere-ellipse2 and running the same plot I get this:
Here, the minor axis is much larger than what I prescribed. Again, for more modest major,minor combinations this result converges well on the other two. This algorithm uses the definition of the ellipse that the sum of the distances from the two focal points to the ellipse perimeter shall be a constant 2a, where a is the semi-major axis. So, if I let the major axis increase from 170 to 180 the focal points are at latitude 12.0577136594 (sqrt(180^180 - 90^90)), with longitudes 180 apart. Turns out the sum of distances from any point on Equator to these two points equal 180 degrees, meaning it does not matter what minor axis I specify, I get a full Equatorial circle for that case. That seems a bit odd to me as well.
Maybe @WalterHFSmith can cut through the fog on these postings.
Beta Was this translation helpful? Give feedback.
All reactions
-
Perhaps @WalterHFSmith is enjoying his summer vacation? Hard to imagine Walter not having an opinion on this!
Beta Was this translation helpful? Give feedback.
All reactions
-
The ellipse is a plane figure and I don't know what it means to discuss it on a sphere or an ellipsoid. I think you have to choose some arbitrary definition and go with that.
If you start from the notion that an ellipse is an intersection between a right circular cone and a plane (for certain orientations of the plane only) then I think you cannot add a sphere intersecting that in any sensible way.
If you start from the notion that an ellipse is the set of all points in the PLANE having a common sum of distances to two focal points in the PLANE then I think you can't sensibly translate that to a sphere either.
So what are we trying to do practically? The practical applications of this when the ellipse size approaches the size of a great circle are hard to imagine. Practical cases are illustrating a zone of uncertainty centered on some point. The info would have to come with an azimuth of the long axis, and major and minor semi-axis lengths.
I believe your first approach, Paul, makes sense EXCEPT that I would not have drawn the ellipse on an equal-area projection, but rather on an equidistant projection in which distances from one point (the center of the ellipse) are true distances. In that projection I would draw the ellipse, then invert the projection to get a set of lon,lat points that trace its path.
Note that equidistant projection is going to involve some compromise on an ellipsoid, I think, but again, the method is only practical if the ellipse semi-axes are in some sense "small", and so the compromises might be managed.
But my idea may be stupid, because if the ellipse is "small" then whether you use equidistant or equal area or conformal to develop it might not matter much. And a too-large ellipse is always going to fail.
One more note on what is "practical": if we assume again that the reason for drawing this is to show a zone of uncertainty, and if the zone is "large", then we really want to draw (on the sphere, supposing) some contour of probability density for something like a Von Mises - Fisher (?) distribution. In that case once the dispersion gets large then the shape of the confidence interval should do something sensible on the sphere, and thinking of it as an "ellipse" is no longer correct.
To say another way, suppose the reason for drawing the "ellipse" is to draw a contour illustrating the zone on the surface of the earth such that a point is expected to fall inside this contour with probability 0.5. Well, once this contour becomes a great circle path that goes all the way around the earth, then we are saying that the point has equal probability of being anywhere (with probability 0.5 it is in the "inside" hemisphere but with equal probability it is in the other hemisphere). And so if an ellipse represents a zone of confidence then it is nonsense when it gets too big.
Just my 2 cents.
Beta Was this translation helpful? Give feedback.
All reactions
-
Doing a Bigham distribution on a sphere is not going to happen, and I agree perhaps equidistant would have been better. As you say, for these large dimensions it will break down anyway, and for more modest sizes they all converge well. So perhaps what we do is not so bad as it still looks like an ellipse even if very large. I will test with equidistant but suspect I have no good way of measuring "better".
Beta Was this translation helpful? Give feedback.