Saturday, November 21, 2026

Simple Method to Calculate the GHA and Declination of the Sun for Navigation

Simple Method to Calculate the GHA and Declination of the Sun for Navigation – Updated Approach

by

Wendel Brunner

In The Calculator Afloat, Shufeldt and Newcomer describe a simple way to calculate the GHA and declination of the sun for any date and time during a year using two parameters specific to that calendar year (Schufeldt, pp172-179). They tabulated values for those parameters for the years 1979 through 1999. Harris, in Astro Navigation by Pocket Computer, updated those parameters to include the years 1988 through 2010 (Harris, pp 69). These calculations are quite practical using just an inexpensive scientific calculator. Here we provide updated parameters for the years 2025 – 2045 and make some additional adjustments to Improve the accuracy of the results.  

This method is a simplification of the formulas in Astronomical Algorithms by Meeus for low accuracy solar coordinates (Meeus, pp163-5). Using the nomenclature of Harris, the parameter P is the Mean Anomaly of the Sun at the start of the calendar year, and the parameter Q is P minus the Mean Longitude of the Sun at the start of the year. Harris also provides an annual parameter R, which is the GHA Aries at the beginning of the year and is useful for working star sights.  B represents the date and time for the required Solar GHA and declination in days and fractional days since the start of the year. There are a number of tables giving the integral day of the year (DOY) by date. Such a table is often included in the Nautical Almanac. The value of B is found by the formula B = DOY + GMT/24. In the convention used here, the value of B for January 1 at 0h GMT is 1, corresponding to day 1 of the year. The values of P and Q are not really “at the start of the year”, but rather from the day before – calculated from from Meeus formulas 25.3 and 25.2 using the value of T (Julian centuries since the epoch 2000) corresponding to 12/31 0h GMT of the previous year. 

Below is the formula for calculating the GHA and declination of the Sun, where M is the Mean Anomaly, L is the Apparent Longitude, E is the declination and F is the GHA of the sun:

M = .985647B + P

L = M + 1.913sinM + .02sin2M – Q

E  = ArcSin(.3977sinL)

F = ArcTan(.9175tanL)  

If cosL < 0. Then F = F -` 180

F = 360Frac(B) + M – F – 180 - Q

The term 1.913sinM + .02sin2M is called the Equation of Center. That term added as a correction to the mean longitude, M – Q, yields an approximation of the true longitude L. The arcTan(L) must be in the same quadrant as L. If Cos(L) is < 0 then F = F – 180. Frac(B) is the remainder of B after the integer number of days is subtracted (fraction of day). In line 4, F is the Right Ascension; in line 6, F is converted to GHA. 

The inclusion of the R parameter allows the calculation of the GHA Aries by the formula:

GHA Aries = R + 360.985647B = R + 360Frac(B) + .985647B 

Line 6 could also be written: F = GHA Aries  – F; or F = R + 360Frac(B) + .985647B - F , which seems more intuitive to me.

Example: Calculate GHA and declination of the sun for April 12, 2030 at 22:15:15 GMT

For 2030, P = -3.7414      Q = 76.5479   R = 99.7099

4/12 is DOY 102. B = 102 + 22:15:15/24 = 102.9272569

M = .985647X102.92725 – 3.7414 = 97.7085

L = 97.7085 + 1.913sin(97.7085) + .02sin(2X97.7085) – 76.5479 = 23.0510

E = ArcSin(.3977sin23.0510) = 8.9585 = 8deg 57’ 31”

F = ArcTan(.9175tan23.0510) = 21.3266

Cos23.0510 > 0, so F is unchanged

F = 360(.9272569) + 97.7085 – 21.3266 – 180 – 76.5479 = 153.6469 = 153deg 38’ 48”

Or:

F = 99.7099 + 360(.9272569) + .985647X102.9272569 -21.3266 = 153.6457 = 153deg 38’ 45”

The Actual values from truncated VSOP87 theory are: GHA = 153deg 38’ 40” and Dec = 8deg 57’ 32”

Since the fractional part of B is multiplied by 360, one needs to include enough decimal places to maintain accuracy. Using the calculator memories to store intermediate results greatly facilitates the calculation and reduces rounding error.  

Updates and Modifications to Improve Accuracy

The formula for the Mean Anomaly M is not really .985647B + P; it is actually .985600B + P, which is the factor used by Harris (.9856). However, to simplify calculation, the variable value of M already calculated is used to replace the variable value of the Mean Longitude L in line 2. The correct factor for the Mean Longitude is .985647, and since the accuracy of the Mean Longitude is much more important than the accuracy of M (which comes in only as small correction factors involving sinM and sin2M), we use .985647 everywhere.   

The parameters Q listed below include a term to correct for aberration and nutation (Meeus p164). Nutation has a period of 18.6 years, so any error over the year in this correction is less than 3” arc and is usually less than 2”. 

Accuracy and Utility of This Method   

The main errors of this simplified method come from lack of accounting for perturbations of the earth’s orbit by the gravitational effects of the other planets. I checked a sample of results from this simplified method for each year against results for GHA and declination of the sun calculated from a truncated VSOP87 theory utilizing 50 periodic terms (Meeus), as well as an on-line almanac. All the errors I found were no more than 0.3’ minutes of arc, and usually less than 0.2’minutes. The average absolute error in 25 calculations was 7.5” arc for GHA and 4.4” for declination. This is better than one can expect to actually measure from a small boat with a sextant, so this method is quite suitable for small boat navigation. 

A Casio fx-300MS calculator with seven user memories and a helpful “degrees, minutes, seconds” key is available on Amazon for less than $10. Such a calculator is quite practical for these calculations. It also makes quick work of solving the formulas for the Navigational Triangle, thus replacing annual Almanacs and volumes of tables for much celestial work. It is easy to enter this algorithm into a programmable calculator. In 1992, I programmed a small Radio Shack calculator with limited memory with this and several other useful navigation algorithms and navigated a sailboat to Hawaii, never having had to crack a book or mark a plotting sheet. Modern calculators have a lot of memory and can hold the precise algorithms for the sun, moon, planets and stars, although entering those hundreds of periodic terms for the Solar bodies is quite tedious.            

Annual Parameter Updates

Year      P     Q     R

2025 -3.4475 76.6378 99.9140

2026 -3.7034 76.6191 99.6768

2027 -3.9593 76.6006 99.4393

2028 -4.2152 76.5826 99.2015

2029 -3.4855 76.5649 99.9488

2030 -3.7414 76.5479 99.7099

2031 -3.9973 76.5314 99.4705

2032 -4.2532 76.5153 99.2306

2033 -3.5235 76.4995 99.9761

2034 -3.7794 76.4839 99.7358

2035 -4.0333 76.4683 99.4955

2036 -4.2912 76.4525 99.2554

2037 -3.5615 76.4363 100.0013

2038 -3.8174 76.4197 99.7620

2039 -4.0733 76.4025 99.5232

2040 -4.3292 76.3848 99.2850

2041 -3.5995 76.3666  100.0329

2042 -3.8554 76.3481 99.7955

2043 -4.1113 76.3293 99.5583

2044 -4.3672 76.3105 99.3212

2045 -3.6375 76.2918  100.0696


References

1) Shufeldt, H and Newcomer, The Calculator Afloat, Naval Institute Press, 1980 

2) Harris, M, Astro Navigation by Pocket Computer, Adlard Coles, 1989

3) Meeus, J, Astronomical Algorithms, Willmann-Bell, 1998



Friday, September 18, 2026

Sextant Piloting: The Three-body Fix

This blog post will eventually be a more thorough reference on doing 3-body piloting fixes with  sextant, but for now it is mostly background. I will fill it in as time permits.

___________

Many mariners learn navigation without getting into sextant piloting, despite the fact that it is one of our most powerful means of locating our position when we do not have access to GPS.  In part this is due to the subject not being covered much in standard texts, but we do cover it in all of our works, and we have an extended discussion the booklet: How to use Plastic Sextants.


We were led to putting that content in this book because most of sextant piloting can be accomplished with an inexpensive plastic sextant, even the very basic Davis Mark3. We also have a booklet on the use of the Mark 3, but it does not focus on sextant piloting, just basic cel nav. GPS Back-up with a Mark 3 Sextant, which is a small, 0ne-book complete solution to a celestial fix.



In our recent update to the StarPilot apps, we were reminded that these apps also uniquely solve the 3-body problem, which is a simple sextant piloting technique that leads to a highly accurate position. Good enough, for example, to detect anchor drag in a small bay.

But there are some subtleties to this procedure, which led us to create this training tool on the 3-body problem.

For now this blog post is just a holding place (linked inside the app) for more to follow shortly, plus notes on this app and this procedure...

Sept 19, 2026.


Thursday, August 27, 2026

Automatic Motor Routing in qtVlm

Since the very onset of electronic position finding (from LORAN on up to GPS), we have taught that these aids are wonderful tools for telling us where we are, but we must still master traditional navigation skills, because the electronics will not tell us the best, safe, efficient route to where we want to go.

Well... that is still true, but there is now a huge new caveat to the topic: namely, most modern navigation apps, called electronic charting systems (ECS), offer some form of automatic routing. In short, they do indeed now offer to tell us how to get to where we want to go. 

When this first came out, we made jokes about their advertisements, because the results were terrible and dangerous. Some still are. 

But now, more sophisticated ECS like qtVlm have worked on this exercise using official electronic navigational charts (ENC) plus a lot more respect for traditional navigation routing that can be implemented, because of their careful rendition of the ENCs, which include more information than third party proprietary charts used by some apps.

In all cases, the ECS must warn the navigator to carefully check the results before activating the route and blindly following it, which would be negligent. This is, of course, also true with qtVlm automatic routes, but qtVlm already had in place a top quality route checker function, which can be applied to the routes with a button click, plus they present multiple alerts in areas that should be double checked.

qtVlm calls such routes "S57 Motor Routes," because they are based on S-57 internationally standardized ENC and the assumption is you are under power, so you can steer any direction you choose.

Then, when planning ahead and not in the boat already, you move the boat to the place you want to start, and then go to your desired destination and place a mark at that location, then right click that mark, and choose S57 Motor Route.  That will initiate the  computation of a proposed route (in the form of a pathway), taking multiple factors into account, which we go over below.

The route depends on the dimensions of our boat to account for water depth, bridge clearance, transiting locks, narrow channels, and even entering and leaving marinas! Also, there is the option for larger vessels to follow traffic separation schemes (TSS, "shipping lanes"), or (the default) for smaller recreational boat who would like to avoid traffic and must interact with the TSS according to Rule 10 in the COLREGS.

Prior to computing a route we need to enter a few permanent settings:

• Draft (keel depth below waterline, plus your safety margin)

• Air draft (max height above waterline, plus your safety margin)

• Length overall (A+B in the GPS location diagram)

• Beam (C+D in the GPS location diagram) 

• Intended start time and date

• Intended knotmeter speed (so you can export a route plan with times)

• If LOA (A+B)  > 20m (66 ft) you can choose to participate in TSS

The time and speed inputs are important to qtVlm, but not a usual input for other ECS, because qtVlm can load tide and current forecasts from the Operational Forecast System (OFS) model, which provides tide height and tidal currents across most US waters by GRIB download. When those data are loaded, or coastal current data from coastal models such as NCOM or RTOFS, the routes will take that into account when finding the most efficient route. 

Forecasted water depth can be accounted for because qtVlm has the unique capability to also extract from the OFS data the actual water depths at every point on the chart, so it will account for those when applying your draft and air draft plus safety factors.

If you do not have OFS water depth or current GRIB data loaded, then the motor route ignores both tide and current. The depths controlling the route will then be the depth areas between contours, which you can read with a cursor pick on the chart. If the depth area is 6 to 30 ft, meaning its shallow side is defined by the 6-ft depth contour, and you entered a draft plus safety factor of 8 ft, then the motor route will not cross the 6-ft contour.

On the other hand, with OFS tides loaded and the tide in the area is 5 ft during your selected time of the voyage, then that depth area is effectively 11 to 35 ft and the route could cross it.  Clearly in cases like this, we have to be sure we are traveling at the time we said we were — but there are various alerts to warn of deviations.  

(To be a bit more specific: in routes with tides, the computation does not use OFS tides + charted depths, but rather it uses the OFS water depth, which is computed based on its own digital bathymetry of the area.)

With OFS tidal currents loaded, you could have the option of passing either side of an island, with favorable current on one side and unfavorable on the other. The route would typically choose the favorable side. Without current data loaded, the choice of side could be different. 

Likewise, taking a notable shortcut under a bridge can depend on the tide height, because the charted clearance is relative to MHW. At near-zero tide, you could pick up a lot of extra clearance in some areas.

If you wish to avoid a particular region, qtVlm lets you draw in a barrier line or area that the route will not cross. 

Once the route is computed, you can view and export a detailed route log with times, distances, and headings on each leg. The export could be as CSV for printing or as a GPX file to load the actual route into another device.

The video below illustrates some of these features.


[ to be added ]






Monday, August 10, 2026

How the Fit-Slope Method Works

Since we first proposed the Fit-slope method many years ago, and have used it continually since then, I have just realized that the base reason the procedure works is not as obvious as we might have implied in various descriptions of it. The procedure does often lead to improved sight data; it is mentioned in the latest edition of Bowditch: American Practical Navigator. 

A look at basic least squares fit analysis forces us to find the subtlety that makes it such an important aid to celestial sight analysis. But first, a bit of background.

( See also our new Fit-slope tool to expedite the analysis described at the end plus video demo. )

__________

In celestial navigation, we take a series of sextant sights of a specific body whose height is changing with time, so we end up with a list of times (x) and sextant heights (y). Over a short period of time, the celestial body height changes in a linear way. But our measurements always include some random errors, along with possible systematic errors, as well as periodic blunders. The data points then scatter about a straight line that represents the rise or fall of the height with time as perceived from our moving vessel.

Random errors come from varying judgements on best alignment of the body and the horizon as well as random errors in reading and recording the time of the alignment. Systematic errors might be due to a fading horizon during an evening twilight session. Blunders happen by reading the micrometer incorrectly, or reading 12 on the sextant dial or watch, and then writing down 21.

Such sights might be for an LOP from any celestial body, or they could be a series of lunar distance measurements. The process and initial analysis we discuss here is the same.

We take a series of sights of any one body with the goal of getting just one value, a single time and height that best represents the series of measurements, hopefully averaging out at least the random errors, and catching and removing the blunders. An important procedure we follow to improve on this is to try to take at least 4 sights of 3 different bodies, as near to 120ยบ apart as possible, and we alternate the sights, rather than take all of one body, then all of the next. This method also ensures we get a fix as soon as possible, in case we are somehow interrupted.


An exception occurs with evening sights of Venus, because we can often get a whole series of Venus sights with a sharp bright horizon before we can even see the stars we want to combine with it.


We end up with 4 or 5 sights of each body, and do the following for each set. We plot the Hs (y) vs. time (x) and then draw a straight line through the points, which is intended to represent what the values would be if we did them all precisely. Then we can choose any point on this line to represent the full set of measurements of that body. 


Doing this by hand, we lay a clear plastic ruler on the data so as to go through the most points possible, adjusting the line to leave as many points above as below the line. The difference between any data point and the line is called the residual, with plus above and minus below. The goal is have the sum of these residuals near zero. Points notably off the line could be ignored or weighed less when choosing the line's position. Note we can move the line up and down and we can rotate it to get the best alignment. 


This process is essentially a manual "least squares fit" to a straight line. Using a spreadsheet program like Excel, we would plot the data and then add a linear trend line, which gives us the equation of the best fit line, y = a + bx, where b is the slope and a is the intercept, meaning value of y when x = 0.


Knowing this mathematically correct best-fit line (we get from Excel), we can compare it with what we get when doing it by eye, no math involved. And it turns out that with a bit of practice, the human eye can do a remarkably good job in choosing the best fit, and thus we do not really add much to the analysis with Excel—assuming that is all we wanted out of Excel: the best fit line so we could choose a single sight that we could consider an average of the set for that body.


I think of the above as standard procedure in cel nav, without introducing the Fit-slope Method, which we will look at now.


The principle behind the Fit-slope Method is simple: we can compute the slope of the Hs vs. time line, so when fitting the line, with Excel or by eye with a parallel plotter, we can keep the slope constant as we look for the best fit. That restricts the choice of best fit line position and hence our choice of best representative sight. 


We compute the slope by computing Hc1 at a time at the start of the sight session from the DR at that time (t1) and then again from the DR at the end of the sight session (Hc2 at t2). The slope of the line is then (Hc2-Hc1)/(t2-t1). Plotting by hand we do not need this numeric value, we just plot Hc2 and Hc1 on the same plot as the actual Hs sights and draw a line between them. These Hc values will need a new scale, because they differ from the Hs values by the sum of the altitude corrections. Once on the same plot, we just align a roller plotter with the computed slope and then move it up and down, without rotation, to find the best fit.


That is pretty much the extent of the explanation we have given on how to use the method, followed usually by a couple examples. The Fit-slope Method almost always leads to an improved fix from a set of sights.


____________


But if we look at the details of least squares fitting, we can see that the above discussion has not focused in on why the method actually gets us better averages. It is implied, but not stated, and now I want to clarify how this works


I will state the key points, then at the end show the related math derivations. 


As mentioned above, a linear least squares fit to a table of x vs. y values gives the equation of the best line as y = a + bx. That best-fit line will always pass through the mid point of each axis (x-bar, y-bar), which is called the centroid point of the data set. x-bar is the average of all the sight times and y-bar is the average of all the Hs values.


Thus if the whole goal of the process is to find a single point on the best fit line using all of the sights, then you do not have to plot anything at all. Just choose Hs (best) = the average of all Hs values, and assume this is the value at time T = the average of all the sight times. That collapses the entire analysis to just averaging all of the sight data you have.


A less obvious result to many—though mathematically even simpler—is, if you force the least squares fit to have a fixed, specific slope (i.e., constant b) then the best-fit line will also go through the same centroid point of the data set, and you could again choose the midpoints as best representative of the set. The Hs values at any other time than the centroid will be different, but if the goal is just find a single point on the best fit line, the centroid point will still do the job.


According to that analysis, there is no difference between fit-slope and no fit-slope on choosing a single sight to represent the best average of the set!


The subtlety underlying why the fit-sope gets us a better average in light of the above mathematical facts is that we have assumed we are averaging all of the sights in both cases. 


In most cases, however, we are not using the same set of data in both cases. When using the proper slope we can better tell which sights are likely wrong or outliers, and remove them from the computation of the average. When we change the sights in the average, the average changes, so there is not in practice a common sight solution to the fit-slope vs. no-fit slope solution. Removing only one sight in the set can have a notable effect on the fitted line and centroid value. 


In the end, the fit-slope method is not so much a mathematical result. It is simply a guide to helping the human navigator choose which sights belong in the full set to be averaged. It is easy to find sets of real data that show that using the right slope changes the sights we consider too high or too low. 


In good conditions, we are looking for small corrections to what we might consider a good set of sights to begin with. In poor conditions, with hit and miss sights, of say a sun popping in and out of the clouds, or sights in big seas where we have to wait for a good view of the real horizon, then we might have a large scatter in the data points and the fit slope method is a hope to pull an improved fix out of poor data.


Note that fitting with fixed slope (b) in Excel is not as easy as just "Add trend line" that fits both a and b, but as noted we can do this all manually just as fast or faster than with Excel.


Another note is for the fit-slope method, we must indeed compute the Hc at the beginning and end using some app or formula to get the right slope. Pub 229 does not work for this as we need values for specific DR positions and those corrections in Pub 229 are tedious, and Pub 249 is not accurate enough.


___________


Here is Claude's proof that the best fit line goes through the centroid without a fixed slope and also with a fixed slope.





Below is then the same proof for a fixed slope:




___________________


• Below are the numerical examples in the Fit-slope tool app. 

• They are samples of real data from the book Hawaii By Sextant.   


Video demo of the process 


__________________

Sample data 1
hh,mm,ss,Hs-deg,Hs-min
14,55,12,28,50.2
14,56,34,29,03.2
15,01,40,29,55.6
15,15,25,31,55.2

Ref 1
14,55,00,28,35.7

Ref 2
15,16,00,32,12.5

Desired sight time
15,00,00

Known slope
14866.29

------------
Hawaii By Sextant, Prob 27, sights #38b, Capella (12)
7/21/1982z
C=232, S=7.6

DR 1455 = 22 07.8n, 155 08.1w, with Hc = 28 35.7
DR 1516 = 22 06.2n, 155 10.4w, with Hc = 32 12.5

=========================
Sample data 2
hh,mm,ss,Hs-deg,Hs-min
04,53,55,48,56.0
04,54,45,48,50.5
04,56,47,48,40.0
04,58,17,48,32.7
04,59,17,48,27.0

Ref 1
04,53,00,49,09.0

Ref 2
05,00,00,48,34.4

Desired sight time
04,56,00

Known slope
-7117.71

-------------------
Hawaii by Sextant, Prob 18, sights #28a, Jupiter
7/17/1982z
C=247, S=7.7

DR at 0453 = 27 47.0n, 144 39.4w, with Hc = 49 09.0
DR at 0500 = 27 46.6n, 144,30.0w, with Hc = 48 34.4

===========================
Sample data 3
hh,mm,ss,Hs-deg,Hs-min
05,35,24,22,44.8
05,37,08,23,09.0
05,38,19,23,23.2
05,40,06,23,49.0

Ref 1
05,30,00,21,24.0

Ref 2
05,40,00,23,42.1

Desired sight time
5,38,00

Known slope
19886.40

------------
Hawaii by Sextant, Prob 26, sights #37c, Altair (51)
7/21/1982z
C=217, S=5.7

DR 0530 = 22 49.7n, 154 05.1w, with Hc = 21 24.0
DR 0540 = 22 48.9n, 154 05.7w, with Hc = 23 42.1

=========================

The app only reads the data above the single dashed line.