Michael George wrote:
However the OP's requirements were not that he needed to transform points, but that he needed to generate latitude, longitude and heading information to submit to another system.
That leaves me wondering what the other system expects you to send for a heading when you're at the north or south pole. Whatever direction you're facing in, your "heading" is always due north or due south. I suppose you're just not allowed to be exactly at those points, or too close to them.
Quats seem a better fit for this IMO.
Yes, that's probably true. BTW, it occurred to me after posting that there's another way to think about it that's quite a lot simpler -- instead of moving the observer, keep the observer still and rotate the earth under him. That way there's no change of position, only orientation. To move forward/backward by an angle a, rotate the earth in global coordinates by Rx(a); for left-right, Ry(a); and to change the observer's heading, Rz(a) [assuming the global z axis is pointing toward or away from the centre of the earth]. Forward-back: R' = Rx(a) * R Left-right: R' = Ry(a) * R Change heading: R' = Rz(a) * R Now extract your angles from R by whatever means and send them to the other system. -- Greg