Finding Position from two observed Altitudes
Each measured Altitude of a celestial body yields a LineofPosition (LoP).
The obtained LoP is a circle on the globe, centered on the Geographical Position (GP)
of the observed body at the time of the measurement and the circle radius (R in degrees) is
directly related to the measured Altitude (R = 90°  Ho).
Consequentely, two measured Altitudes yield two "CirclesofequalAltitude",
which will generally intersect in two different points.
Since a careful navigator will always have a resonable good estimate of his current
position, one of the two intersection points can be discarded due to it's large
distance from the estimated position.
This makes it possible to uniquely determine the current position from only two
Altitude measurements.
In the following section a mathematical method for finding a position from two
observed Altitudes will be described. 

Trigonometric Setup for the Position Problem

The picture on the left shows the principle situation on the Celestial Sphere
with the positions of the observed bodies (P0, P1) and the  unknown  position
of the observer's Zenith (Z).
These three points together with the Celestial North Pole (CNP) define four (!)
different spherical triangles on the Celestial Sphere.
The following triangle elements are known:
The Positions P0 and P1 with their coordinates on the
Celestial Sphere are known from the Nautical Almanac:
P0 (Dec0, GHA0) and P1 (Dec1, GHA1). This data defines
two sides and one angle of some of the triangles.
The observed Altitudes H0 and H1, which define two more
sides.

Trigonometric Solution for the Position Problem
With this setup, the following steps can be performed to solve all the
angles and sides of the spherical triangles solving also the unknown
values for Latitude and Longitude of the unknown position "Z".



1. Calculate the unknown elements D, A0 and A1
of the spherical triangle P0  CNP  P1:
D = acos(sin(Dec0)*sin(Dec1) + cos(Dec0)*cos(Dec1)*sin(GHA0GHA1))
A0 = acos((sin(Dec1)sin(Dec0)*Cos(D))/(cos(Dec0)*Sin(D)))
A1 = acos((sin(Dec0)sin(Dec1)*Cos(D))/(cos(Dec1)*Sin(D)))
2. Calculate the angles a0, a1 and d in the
spherical triangle P0  Z  P1:
a0 = acos((sin(H0)sin(H1)*cos(D))/(cos(H1)*sin(D)))
a1 = acos((sin(H1)sin(H0)*cos(D))/(cos(H0)*sin(D)))
d = acos((cos(D)sin(H0)*sin(H1))/(cos(H0)*cos(H1)))
Note 1: the angle d has to be in the range 45° to 135° to obtain
a resonable accuracy with this method taking into account that the Altitudes
H0 and H1 cannot be measured with extreme accuracy.
Note 2: there are two valid (a0,a1) pairs: (+a0,+a1) and (a0,a1) obtaining
two valid solutions for the position (Z).
3. Calculate the angles B0 and B1:
B0 = A0 ± a0
B1 = A1 ± a1
4. Calculate the Latitude of Z from both triangles:
Lat = asin(sin(H1)*sin(Dec1)+cos(H1)*cos(Dec1)*cos(B1))
Lat = asin(sin(H0)*sin(Dec0)+cos(H0)*cos(Dec0)*cos(B0))
Note: the precision of this procedure can be enhanced by taking the
average of both Latitude values.
5. Calculate the Local Hour Angles of Z (applying the Law of Sines) from both triangles: LHA0 = asin(sin(B0)*cos(H0)/cos(Lat))
LHA1 = asin(sin(B1)*cos(H1)/cos(Lat))
From the Local Hour Angles, the Longitude of Z can be determined by:
Lon = ± GHAx ± LHAx (x=0/1). The correct signs must be obtained from
the geometrical constellation.



The calculation scheme elaborated above is also implemented in an
interactive Javascript application.
