So basically I would like to:
- Draw a path between two positions in Earth, with longitude and latitude coordinates
- Be able to render this path with multiple straight lines (e.g. with OpenGL)
- Specify an altitude, and bonus points for being able to arc over the sphere (e.g. a flight path)
- Doesn’t really matter which language it’s in. I can translate 🙂
There is the “great-circle” distance formula, but I’m not sure how I would apply it into this problem.
All right, here’s my approach. If any of the steps are unclear, tell me and I’ll elaborate.
(The magnitudes |A| and |B| will be the radius of the Earth if we’re staying on the ground.)
We will rotate around this vector, c, to carry A to B, and the magnitude of c is the cosine of the angle between A and B: theta = acos(|c|). Pretty cool, huh?