What follows is a development of the formulas found in the Aviation Formulary by Ed Williams and in Movable Type Scripts by Chris Veness, from the formulas of spherical trigonometry, to solve the direct problem of geodesy (obtain the coordinates of the destination point, knowing the azimuth of origin and the distance traveled over a great circle) on a spherical surface:
This is not a map of the Earth. This is a map of a spheric world, whose
Radius = 1 (dimensionless).
In this map, a spheric triangle was drawn.
The vertices of the triangle are:
N North pole.
1 Start point of a travel.
2 End point of a travel.
The travel was started with initial azimuth
alpha_1, and traveled a distance
The distance, on the unit sphere, is equivalent to the angle covered by the arc traveled, in radians.
If you want to perform your calculations over a sphere of radius
R, and travel a distance
d, you need to transform:
s = d / R.
lambdaare longitudes, in radians.
phi are latitudes, in radians.
One side of the triangle measures
s, and the other two measure the respective collatitudes of the vertices (
PI() / 2 - phi).
s are given.
From the Spherical Law of Cosines, we know that:
COS(PI()/2-phi_2 ) = COS(PI()/2-phi_1) * COS(s) + SIN(PI()/2-phi_1) * SIN(s) * COS(alpha_1)
But, whether we remember the trigonometric identity for the cosine of a subtraction, or remember that the sine is the same function as the cosine, out of phase
COS(PI()/2-phi_2) = SIN(phi_2) and
COS(PI()/2-phi_1) = SIN(phi_1)
SIN(phi_2) = SIN(phi_1) * COS(s) + COS(phi_1) * SIN(s) * COS(alpha_1)
The angle at
lambda_2 - lambda_1,
delta_lambda from now.
Write the cosine law for the
s side of the triangle.
COS(s) = COS(PI()/2-phi_1) * COS(PI()/2-phi_2) + SIN(PI()/2-phi_1) * SIN(PI()/2-phi_2) * COS(delta_lambda)
COS(s) = SIN(phi_1) * SIN(phi_2) + COS(phi_1) * COS(phi_2) * COS(delta_lambda)
COS(delta_lambda) = (COS(s) - SIN(phi_1) * SIN(phi_2)) / (COS(phi_1) * COS(phi2))
Now, write the Spherical Law of Sines that describes the relationship between
s, in terms of the relation between
alpha _1 and
SIN(delta_lambda) / SIN(s) = SIN(alpha_1) / SIN(PI()/2-phi_2)
SIN(delta_lambda) = SIN(alpha) * SIN(s) / COS(phi_2)
Now, the tangent of
TAN(delta_lambda) = SIN(delta_lambda) / COS(delta_lambda)
TAN(delta_lambda) = SIN(alpha_1) * SIN(s) * COS(phi_1) / (COS(s) - SIN(phi_1) * SIN(phi_2))
lambda_2 in terms of
lambda_2 = lambda_1 + delta_lambda
lambda_2 = lambda_1 + ATAN(SIN(alpha_1) * SIN(s) * COS(phi_1) / (COS(s) - SIN(phi_1) * SIN(phi_2)))
Note the ambiguity that the arctangent function returns the same result for opposing arguments, so it must be decided whether to add (or subtract)
PI() to its result, based on the quadrant in which the argument is. This ambiguity is solved by the ATAN2 function.