# Geographic coordinates to pitch+yaw+pitch

I'm creating a very basic simulation which involves air travel across the world and am trying to correctly position and orient my aircraft in a rendered 3D representation.

I am representing the Earth as a perfect sphere with unit radius and each aircraft as two geographic points on the surface of the sphere (current position and destination). Aircraft should always move along the shortest path to their destination (great circles); no other factors are considered.

In my head, always moving along great circles should make this easy. The "starting point" for aircraft is at the south pole, oriented along the prime meridian, with all rotations taking place around the center of the Earth. Correctly positioning and orienting the aircraft should then be a matter of:

1. Finding the great circle which passes through both the aircraft's current position and destination.
2. Calculating the point of intersection between that circle and the prime meridian.
3. Pitching the aircraft along the prime meridian to the point of intersection.
4. Yawing the aircraft so that it is oriented along the circle.
5. Pitching the aircraft along the great circle until it reaches its current position.

Unfortunately, I don't know how to accomplish the first step, let alone all five.

I'm currently representing coordinates as decimal longitude/latitude, but translating those into yaw/pitch radians or UV coordinates is trivial, if that makes the math simpler. I'm also not currently interested in distance or time, just position and orientation.

Can anyone provide me with the formulas to implement this? (Or point me towards an alternate approach if I'm barking up the wrong tree?) In particular, I'd be grateful for a good resource on this type calculation; I imagine I'll be doing quite a bit of it in the near future and my Google skills have so far failed me.

-
Seen this? – J. M. Apr 24 '11 at 16:54
@J. M. — No, but that looks like a good one. I'll dig into it. Edit: Oh, and thanks for the retag. I suspected there was a more specific term that I was missing. :-) – Ben Blank Apr 24 '11 at 16:55
Okay, it looks like I was indeed overcomplicating things. It's much, much easier to position the aircraft by yawing to the correct longitude, pitching to the correct latitude, and then orienting it separately by yawing again to the true course between the position and destination. @J. M. — If you post that link as an answer, I'll accept it. – Ben Blank Apr 24 '11 at 18:03