How to calculate center of great circles

Tips and tricks for using Geocart 3
Atarimaster
Posts: 422
Joined: Fri Nov 07, 2014 2:43 am

How to calculate center of great circles

Post by Atarimaster »

Hello,

I think I mentioned before that I’m not good at math… ;-)
So maybe someone can help me here.

Before we start: I know that it’d be easier to solve my problem using an image processor on a file that was exported from Geocart, but for various reasons I’d like to do it with Geocart’s options.

As I’ve mentioned in another thread, I’m thinking about a map using the azimuthal equidistant projection, centered to the place where I live.
And I’d like to add a number of great circles passing through the center of the map. The result should look like this:
demo-greatcircles.png
demo-greatcircles.png (26.83 KiB) Viewed 2126 times

As you can see, I’d like lines at a step width of 30 degree (meaning the angle of the lines, not any lat/long values), at least for the moment. I might change my mind on the number of great circles I want.

I know that I can use a metric lines database, with a few entries of that kind:

Code: Select all

<great_circle center='Y,X' />
And I’m fairly certain that you can calculate the various values for X and Y using the lat/long values of the center of the map and its antipode and the step width.
But HOW do you do that?
My guess is that it isn’t even that hard, but … (see first line)
So could somebody please help me out here?

Kind regards,
Tobias
daan
Site Admin
Posts: 930
Joined: Sat Mar 28, 2009 11:17 pm

Re: How to calculate center of great circles

Post by daan »

Easy solution: overlay two maps: one centered where you want; the other centered on the north pole, as you have done here.

But I think I must be missing something about your question. Are you asking how to obtain the coordinates for each great circle? Or do you truly just need to draw them? Or do you need (for some unrevealed reason) to draw the great circles on the same map?

— daan
Atarimaster
Posts: 422
Joined: Fri Nov 07, 2014 2:43 am

Re: How to calculate center of great circles

Post by Atarimaster »

daan wrote: Are you asking how to obtain the coordinates for each great circle? Or do you truly just need to draw them? Or do you need (for some unrevealed reason) to draw the great circles on the same map?
I’d like the coordinates for each great circle in order to draw them all on the same map.
The reasons for that is that I’d like to add a second map, one of that kind that are people used to – i.e. centered on [0,0], using a pseudocylindrical or lenticular projection – with the same metric line database, to demonstrate how the great circles look on a »standard« map.
daan
Site Admin
Posts: 930
Joined: Sat Mar 28, 2009 11:17 pm

Re: How to calculate center of great circles

Post by daan »

In a metric lines database, you specify the center by latitude and longitude. It does not matter how you rotate the globe; the great circles will change appearance as you rotate.

I'm pretty sure you know this, so I feel like I am still missing some piece of the puzzle.

—daan
Atarimaster
Posts: 422
Joined: Fri Nov 07, 2014 2:43 am

Re: How to calculate center of great circles

Post by Atarimaster »

Meanwhile, I’ve continued trying and I think I’m on a way to solve this. Unfortunately, I have to stop now and leave the desk, so I don’t have the time to explain it further.
I’m going to explain tomorrow or on monday.
Thanks for your replies, and sorry for the trouble!

Regards,
Tobias
Atarimaster
Posts: 422
Joined: Fri Nov 07, 2014 2:43 am

Re: How to calculate center of great circles

Post by Atarimaster »

… I could get away from the gathering for a few minutes… ;)

Giving me time to post the image of "the way to solve this". It down’t seem to be 100% accurate, but I’m going to see what I can do about it tomorrow.
This is (closely to) what I wanted: The very same great circles that are straight lines on the azimuthal projection become curves lines when projected to a different projection (in this case, Wagner VIII).
The image is, just like you suggested, a composition of two maps: Wagner VIII with graticule and coastline centered to [0,0], and the great circles from a re-centered and transverse Wagner VIII.

Hope that solves the puzzle, and if not: As I’ve said, I’ll be coming back to this.
But now, I’ve got to get back to the guests…

Regards,
Tobias
Attachments
greatcirclesTest-onWagner_2.png
greatcirclesTest-onWagner_2.png (46.41 KiB) Viewed 2112 times
daan
Site Admin
Posts: 930
Joined: Sat Mar 28, 2009 11:17 pm

Re: How to calculate center of great circles

Post by daan »

Ah, I think I see what you mean. You want to be able to specify a great circle emanating from a particular point and going in a particular direction, but Geocart’s metric lines syntax does not provide for this case. That’s unfortunate.

On an overlay projection, you can turn off drawing parallels and then set the projection center so that the overlay’s graticule’s north pole coincides with the point you care about.

The calculation to find the proper latitudinal, longitudinal, and transversal rotations is a little complicated. The easiest I can describe it is that you need to find the Euler angles via a concatenation of 3 3x3 rotational matrices multiplied against the Euclidean 3-vector that represents the geographic point. If you’re only going to do this one time, then the method you seem to have used is probably easiest.
:?

Best,
— daan
Atarimaster
Posts: 422
Joined: Fri Nov 07, 2014 2:43 am

Re: How to calculate center of great circles

Post by Atarimaster »

daan wrote:Ah, I think I see what you mean. You want to be able to specify a great circle emanating from a particular point and going in a particular direction
Yes, that’s it!

daan wrote:but Geocart’s metric lines syntax does not provide for this case. That’s unfortunate.
I guess something like this is very rarely needed ;-) so it’s perfectly understandable that it isn’t provided.

daan wrote: On an overlay projection, you can turn off drawing parallels and then set the projection center so that the overlay’s graticule’s north pole coincides with the point you care about.
That’s what I did now – however I still can’t get a result that’s 100% accurate (see below).

daan wrote: The calculation to find the proper latitudinal, longitudinal, and transversal rotations is a little complicated. The easiest I can describe it is that you need to find the Euler angles via a concatenation of 3 3x3 rotational matrices multiplied against the Euclidean 3-vector that represents the geographic point.
I see.
Better don’t even try to elaborate on this – it would be completely lost on me! *laugh*

daan wrote:If you’re only going to do this one time, then the method you seem to have used is probably easiest.
While I might repeat this now and then, I’ll certainly not be doing this on regular basis. So I’m better off with the »two-maps-solution«.


Now, as I’ve said, my current result isn’t completely accurate.
It’s good enough for my purposes, which is simply giving an idea of how the great circles emanating from a particular point change on a different projection. So I could stop at this point…

… but it really bugs me that I can’t get this done properly and fail to see where at which point I’m doing something wrong.
So, here we go:
The point of interest is 7.22° E and 51.47° N (I’m using decimal degrees here for the ease of typing).

The underlying map is Wagner IX, centered to [0,0]. It includes the coastlines, the meridian at 7.22° E and the parallel at 51.47° N, both printed in red.
The map layered on top of the is of course again Wagner IX, with following settings:
Graticule:
Drawing of parallels turned off, meridian spacing: 30°;
prime meridian: 7.22° E;
origin of longitude spacing: 7.22° E.
Graticule color is set to blue.

Projection Center:
Latitudinal: 38.53°E (= 90 - 51.47)
Longitudinal: 3.61°E (= 7.22 / 2)
Transversal: -7.22°

If I compare this to the azimuthal projection, i.e. take a look where the blue lines intersect with the coastlines, this seems to be right:
wagner-9-demo-c1.png
wagner-9-demo-c1.png (120.8 KiB) Viewed 2103 times


However, the point where the blue lines converge is a little bit off the junction of the red meridian + parallel:
wagner-9-demo-c2.png
wagner-9-demo-c2.png (62.12 KiB) Viewed 2103 times


I’ve tried various combinations of the settings mentioned above, but none of them do the trick.
So, where’s my error in thinking?
In case this helps, here’s the zipped .geo3 file with the two Wagner projections, and for reference, the azimuthal equidistant version (again, with two maps overlaid).

Kind regards,
Tobias
Atarimaster
Posts: 422
Joined: Fri Nov 07, 2014 2:43 am

Re: How to calculate center of great circles

Post by Atarimaster »

Welllllll…
first of all, Latitudinal: 38.53°E (= 90 - 51.47) in the posting above should, of course, be Latitudinal: 38.53°N (= 90 - 51.47) but I guess that typo was obvious. ;)
More importantly, that these values render a result that’s close to what I want seems to be pure coincidence.
I just repeated this calculations for a different location, and it’s completely wrong!

You know the feeling when you try to figure out something so hard that at some point you don’t seem to able to think straight anymore?
I think that’s exactly where I am right now.

So I better let this rest and start fresh in a few days…
:?

Regards,
Tobias
daan
Site Admin
Posts: 930
Joined: Sat Mar 28, 2009 11:17 pm

Re: How to calculate center of great circles

Post by daan »

Come to think of it, Snyder gives a trigonometric form of the Euler angle calculations. I don’t use it because I need more flexibility in the intermediate calculations and because I want to express the pitch, roll, and yaw components separately, but it’s pretty much made for your situation. You can find the formula on p. 31 of Map Projections—A Working Manual. You can find that here if you don’t already have it. If you have trouble deciphering the description and the notation, let me know. As I recall, it’s not entirely obvious.

— daan
Post Reply