# How can I calculate my position (lat/lon) given a sequence of solar-elevation measurements at known times?

The "forward" problem (given time and lat/lon, find solar position angles) is well documented, e.g. here. I am trying to figure out the "inverse" problem: given time and [a sequence of] solar elevation measurements, find lat/lon.

There are some obvious special cases; for example, if I record the exact times of sunrise and sunset, then my location lies at an intersection of solar-terminator great circles.

More generally, at any given time during the day, if the solar elevation is phi, than my location must lie somewhere on the [non-great] circle of constant phi solar elevation. It should be possible to calculate this continuously and, if I am moving, come up with a quasi-real-time position estimate.

Celestial navigation is the right body of knowledge, but all of the references I've found assume labor-intensive measurement (i.e. sextants) and simple hand calculations. I can sense the input data autonomously and continuously, and I have a computer available.

• One thing you didn't mention, but which is an absolute requirement, is an ephemeris to tell you the position of the Sun (relative to the center of the Earth) for the given time. The problem then simplifies down to a three point celestial fix. For the time of one measurement, use the ephemeris to compute the Sun's Geographic Position (GP) [the GP is the lat/lon on Earth where the Sun is directly overhead]. If your sun elevation measurement for that time is 90deg, you were lucky, your position is equal to the Sun's GP. Mar 17, 2022 at 2:33
• But, odds are, it won't be 90deg. If it were 80deg, then you know you're exactly 10 degrees away from the Sun's GP. You can plot this circle of radius 10 on a globe. Repeating this for another of your measurements, you will plot a different circle on the globe which will intersect the other at two points. Repeating the process for a third point, you'll have three circles that intersect at one point, and that's your lat/lon. This process isn't practical in reality, as it requires you to stay in one position for a long period to get measurements far enough apart to produce good accuracy. Mar 17, 2022 at 2:40
• @Greg Miller you actually don't have to stay in one place. You can get morning and afternoon LOPs from the intercept method (if you have a rough idea of your location). To find your position (at the time of the afternoon observation) move the morning LOP by your dead-reckoned change in position. Accuracy would be degraded by the inaccuracy in dead-reckoning. Mar 17, 2022 at 16:48
• How are you continuously and autonomously sensing while moving? How much accuracy do you need? Mar 17, 2022 at 17:24
• @stretch, the platform is a proposed high-altitude "pico-balloon" without GPS. With a pair of vertical solar cells facing the horizon in different directions, and a horizontal solar cell facing the zenith, we believe we can obtain a continuous, albeit noisy, record of solar altitude. This assumes the payload is spinning about the vertical axis---in fact, it depends on it---but that vertical axis is largely stable (not too much turbulence). We'll see! Mar 18, 2022 at 16:16

The equation that relates the altitude, latitude and longitude is as follows: $$\sin{a}=\cos{h}\cos{\delta}\cos{\phi}+\sin{\delta}\sin{\phi}$$ where

• a is the altitude
• h is the hour angle which includes the longitude of the observer (and the right ascension of the Sun which is known from the date and time).
• $$\delta$$ is the declination of the Sun (which is known from the date and time).
• $$\phi$$ is the latitude of the observer.

This gives one equation with two unknowns. From measuring the altitude at two different times, you have two equations and two unknowns which can be solved for latitude and longitude. (Solve for hour angle and latitude first.)

There may not be a direction solution to the two equations since it involves trig functions. The solution may require an iterative approach which is easier to do since you have a computer.

The solution may be easier if you measure the azimuth of the Sun also; or at least knowing the azimuth (az) will give you a first approximation of the longitude. $$\tan(az) = \frac{\sin(h)}{\cos(h)\sin(\phi)-\tan(\delta)\cos(\phi)}$$

Edit: I should point out that the time needs to be Universal Time in order to determine the latitude. The time cannot be the local time. For example, if it is 10 am local time and you are at 30° latitude, the Sun will be in the same basic position regardless of your latitude. The exception is if you know the "standard latitude" for your time zone (0°, 15°, 30°, ...). Then the equations can be used with the local time to find the offset from the standard longitude.

Greg Miller also pointed out in comments that two observations and the altitude equation are not enough to determine the latitude and longitude uniquely. For a given altitude from observation 1, there is a ring of latitude,longitude points that are centered on the subsolar point. Observation 2 gives a different ring centered about the new subsolar point. The two two rings intersect at 2 points. To determine which of the 2 points of intersection is correct, a third observation.

• At least three points are required, while a solution will exist with two points, there will usually be more than one solution. Eg. $\cos \phi = \cos -\phi$. If you have the azimuth, you only need one point, as there is only one place on earth an object will have a given alt/az. Mar 17, 2022 at 17:25
• Thanks, this is helpful! Re: nonuniqueness, I suspect one solution or the other may be easy to rule out based on physical plausibility, at least in temperature latitudes. The "computer" in my case is a microcontroller, but we are not terribly energy-constrained due to abundant sunlight, so it would be fun to develop an iterative solver to run on the platform. Telemetry is far more constrained, so it is far better to transmit estimated coordinates than to transmit a bunch of solar observations. Mar 18, 2022 at 16:22
• Also, because the orientation of the platform is unknown (although we believe/hope that it will be horizontal w.r.t. the earth's surface---at least on a time-averaged basis) we can't measure the solar azimuth. Maybe if we added a magnetometer... Mar 18, 2022 at 16:25
• A magnetometer won't help much. Since magnetic North and true North are very different, you have to know your magnetic declination offset to produce an accurate measurement. And you need to know your location to compute that. Mar 18, 2022 at 22:37
• True. I wonder if you could iterate back and forth to convergence. But we're not planning to try this. Mar 19, 2022 at 5:21