I have a little computational geometry project I'm struggling with for a non-commercial "art" installation. It is driving me crazy and I'd happily pay for an implementable algorithm/solution (apologies if Stack Exchange doesn't allow this - I looked but didn't find any restriction on offering a cash bounty).
Given a starting location P1 on the surface of the earth (latitude phi1, longitude L1), compute the exit point P2 (latitude phi2, longitude L2) of a ray that departs from the starting point at local azimuthal angle alpha1 (from true north) with downward altitude angle beta1.
In less formal terms, imagine sitting on a rotating stool. Turn the stool from true north by some angle alpha1. Point your arm straight out. Now drop your arm by angle beta1. Imagine a ray that extends from your pointed finger into the ground. Imagine this ray continuing straight through the earth. What point P2 does this ray emerge from the earth?
Notes and Suggestions:
1) As a first approach, suggest using a spherical earth model. Here are some useful resources, http://www.movable-type.co.uk/scripts/latlong.html
2) The "direct Vincenty method", http://en.wikipedia.org/wiki/Vincenty%27s_formulae, is potentially useful. It provides an iterative approach to the related problem of determining the azimuthal angles when point P2 is known. The method uses an oblate spheroid model of the earth (same as WGS84)
3) Determine how much accuracy is improved by 2 versus 1.
4) Determine if incorporating height above sea level of P1 or P2 has significant impact on answer.