Search code examples
geometrycoordinate-systemsspherical-coordinate

Project position on Earth to higher altitude with local azimuth and elevation


I have a position on Earth (π‘™π‘Žπ‘‘1,π‘™π‘œπ‘›1,𝑅𝑒) of which I want to project a straight line with a known azimuth and elevation to a certain altitude, π‘Ÿ. Thus obtaining new coordinates on the projected sphere, (π‘™π‘Žπ‘‘2,π‘™π‘œπ‘›2,𝑅𝑒+π‘Ÿ).

How do I calculate π‘™π‘Žπ‘‘2 and π‘™π‘œπ‘›2 with all other information available?


Solution

  • Altitude change does not influence on azimuth (as projection of path onto sphere), so you can use Destination point given distance and bearing from start point section from here to get final coordinates from start coordinates and bearing:

    Formula:    
    Ο†2 = asin( sin Ο†1 β‹… cos Ξ΄ + cos Ο†1 β‹… sin Ξ΄ β‹… cos ΞΈ )
    Ξ»2 = Ξ»1 + atan2( sin ΞΈ β‹… sin Ξ΄ β‹… cos Ο†1, cos Ξ΄ βˆ’ sin Ο†1 β‹… sin Ο†2 )
      where Ο† is latitude, Ξ» is longitude, ΞΈ is the bearing (clockwise from north), 
      Ξ΄ is the angular distance d/R; d being the distance travelled, R the earth’s radius
    
    JavaScript:    (all angles     in radians)
    var Ο†2 = Math.asin( Math.sin(Ο†1)*Math.cos(d/R) +
                        Math.cos(Ο†1)*Math.sin(d/R)*Math.cos(brng) );
    var Ξ»2 = Ξ»1 + Math.atan2(Math.sin(brng)*Math.sin(d/R)*Math.cos(Ο†1),
                             Math.cos(d/R)-Math.sin(Ο†1)*Math.sin(Ο†2));
    
    The longitude can be normalised to βˆ’180…+180 using (lon+540)%360-180