CNCalc – A smartphone-based calculator for Celestial Navigation.

What, Why and How.

Antonio Eliasantonioe@verizon.net

What

CNCalc is a calculator designed to help in the reduction and plotting of celestial navigation sights. CNCalc looks like a somewhat narrow but rather long web page. In reality, that long page consists of a series of sections loosely linked (you can scroll from the first to the last without interruption.)

Figure 1

The first section is the ALMANAC. Given a Universal Time (UT1, what used to be loosely called GMT) and date, and a celestial body (selected from the Sun, the Moon, the four bright planets, the 57 navigational stars and Polaris) this section shows a number of useful Almanac data: Greenwich Hour Angle of Aries, the body's Right Ascension and Sidereal Hour Angle (thought these two numbers represent the same quantity), and the body's Greenwich Hour Angle and Declination.

WARNING: A stern reminder to all who use GPS as a source of accurate time: UTC = GPS Time - 16s

Some GPS receivers, or devices that use GPS as a source of time, correct for this bias, OTHERS DO NOT! Experiment with your GPS device to see in which category it belongs before using it as a source of UT1!!!

We follow strictly the traditional astronomical rules: Hour Angle increases Westwards from 0 to 360 degrees (or from 0 to 24 hours, depending on the units) whereas Right Ascension is positive Eastwards, negative Westwards and spans from minus 180 to plus 180 degrees.

CNCalc can display the Almanac results in one of three formats: dd mm ss (format 1), dd mm.mm (format 2) and hh mm ss (format 3). The button labeled “Format N” cycles through these three as well as indicates which one is in use. The only exceptions are Declination, Semi-diameter and Horizontal Parallax which would look very weird in the hh mm ss format. You can also choose the number of significant digits displayed from 0 to 3.

Figure 2 Figure 3

The “ΔT” window display an automatically-computed time bias (in seconds) between UT1 (what the radio tics give you) and Terrestrial Time TT (what the Almanac calculations need). CNCalc uses a table of historical values from 1657 (the first year for which ΔT can be reliably estimated) to November 2011, and more-or-less reliable guess-predictions of the values to 2020. You can override the lookup value by entering a number, but if the year changes the lookup value overrides the entered value. In practice, only the Moon ephemerides (sic - plural of “ephemeris”) are affected by a wrong value of ΔT.

I labeled the next section SIGHT REDUCTION. Here, you choose an assumed position (not restricted to integer values as when using tables!!!) from which CNCalc will compute a number of interesting time-related items, such as the Meridian Time Difference (MTD), the Local Time Difference and the Local Hour Angle of the body selected in the Almanac section.

Figure 1

Next, enter a Sextant Altitude (H sextant or Hs) in the degrees and minutes windows. You can select if the horizon you are using is the real one, a bubble horizon, or the reflection of the body in, say, a pan of water (unfortunately I make most of my observations in my back yard using this method…) In the latter case, CNCalc remembers to correct for instrument error before dividing the angle by two, avoiding the error that the explorers Lewis and Clark made in their famous 1805 expedition when they systematically corrected the full Index Error after dividing the reflected image angle by two. Also, in this case, as in the “bubble” case, the dip correction (Eye Height) is ignored.

Next, the limb (or center) is selected and the Index Error, Eye Height and atmospheric temperature and pressure are entered, with a choice of units. As an aid, the distance to the horizon is displayed as soon as an Eye height is entered. The Sight Reduction output goes though the individual corrections to the Observed Altitude (Ho) which is then compared with the Computed Altitude (Hc) to produce the Intercept, and finally the Azimuth of the intercept direction is shown. There is an interesting “cheat”: if you tap the button labelled “C ” the calculator will figure out what sextant altitude will result, after all the corrections are applied, in a value of observed altitude equal to the computed altitude. This is especially useful to create sample problem sets.

Figure 1

Next comes the FIX section, which contains four “slots” each of which can contain a sight. The down-arrow (↓) buttons copy the current sight in the previous section to that slot, while the up-arrow (↑) button transfer that sight to the main sight section for review or editing.

Figure 1

The lines of position can be offset from each other to implement a running fix by specifying an offset (distance and bearing) for each sight; the user selects one of the fixes (usually, but not necessarily the first) as the “reference”, and traditional DR techniques used to estimate the bearing and distance from the selected reference fix to the DR position of the ship at the time of the other fixes. Of course, in the case of a static fix the distances should all be zero.

Figure 1

Up to four sights can be used, but a sight can be selected or deselected for the fix by using the check box to the right of the Distance/Bearing windows. Two sights or more are normally sufficient to determine a fix, but in some cases the geometry of the sights makes determining a fix impossible. In this case, as well as when there is only one selected sight, the legend “NO FIX” is displayed.

Figure 1

If there are enough valid sights for a fix, its latitude and longitude are displayed, along with a rough estimate of the quality of the fix in Nautical Miles (more or less equivalent to the size of the graphical “cocked hat”.) Of course with only two sights, the fix is a single point so the “error” is zero by definition.

The “To DR” button transfers the fix to the Dead Reckoning calculator section (see below).

The next section is labeled WATCH CORRECTIONS and is an aid in determining the UT to use for the Almanac and Sight Reduction sections. In general, the Ship’s watch had a known error at a “Reference Date/Time” and an error rate, in seconds/day. If that data, as well as the observed Watch Date/Time are entered, the observed date/time will be corrected for that error and displayed, along with the current Watch Error in seconds.

Figure 1

If you, as I usually do, mark the observation time with a stopwatch that counts minutes and seconds from the Watch Date/Time, you can enter this additional time, or leave it zero if you simply look up the watch.

The up-arrow (↑) button next to the corrected Date/Time will transfer it to the Date/Time used in the Almanac section.

Figure 1

The next-to-last section is the DEAD RECKONING calculator which computes the lat/lon of a point a certain distance and bearing from an initial point. The initial point can be hand-entered, or be transferred from the Fix section (see above).

The end point can be transferred to the “starting” lat and lon with the double-arrow (↑↓) button, therefore allowing chain-calculation of DR positions.

It is also possible to calculate the distance and bearing from one position to another by entering both sets of lats and lons – CNCalc will then compute the distance and the starting bearing (i.e., the course from the starting point). If the arrival bearing is desired, simply flip-flop the two points with the (↑↓) button and the starting bearing will be the ending bearing of the original direction.

Figure 1

The final section is labeled CURRENT and allows the calculation of current Set and Drift given Heading, Speed Over Water, actual Course and actual Speed Over Ground or, conversely, if Set and Drift and the boat’s Speed Over Water are entered, the Heading to be steered and the resulting Speed Over Ground can be computed. Unlike the previous sections which “Autocalculate” as soon as enough data is entered, you must tap the appropriate button to start the computations in this section (after making sure you have entered the appropriate data.)

Why

At this point you must be thinking: “You are joking, right?” If you have a smartphone, chances are it has a built-in GPS receiver. So why use a smartphone if you’re trying to do celestial navigation? After all, isn’t celestial navigation supposed to be useful when all the lights (including GPS and your smartphone) go out?

Well, the reason we do celestial navigation these days is because there is beauty in doing it, just as there is beauty in the starry sky. The conversion of a physical measurement (the altitude or lunar distance of a heavenly body) to a position – or even time! – by means of mental processes can produce as many endorphins as a Scarlatti sonata or a New York Times crossword puzzle.

But the more tedious aspects of celestial navigation can spoil some of that enjoyment: looking up tables that require silly approximations (especially the sight reduction ones!), the ever-present possibility of an arithmetic error (Einstein was awful at arithmetic!) and, quite simply, fatigue. How enjoyable would a NYT crossword puzzle be if you had to use a thick crayon to write down your answers (and, by the way, the clues were printed upside-down?)

Pre-GPS (but post-personal computer) celestial navigators did not bother with the pleasurable aspects – they simply had a job to do. So, for example, since the mid 80’s, the British “Admiralty Manual of Navigation” (publication BR 45(2) which, among others, includes the syllabus for officers studying for the Royal Navy “Navigation Watch Certificate”,) after carefully discussing the planning of sights, preparation and use of the sextant and plotting sights, replaces all references to the venerable Nautical Almanac and the various sight reduction tables with a detailed description of the NAVPAC (more recently NAVPAC 2) computer program, which all of Her Majesty’s ships are presumed to have.

Using computers (or smartphones) to help with SOME aspects of celestial navigation may not as barbaric or anachronistic as it may seem. At least the Royal Navy doesn’t thinks so!

It is interesting to note that NavSoft, publisher of a commercial version of the Nautical Almanac, also sells the software that produces its Almanac, so users can print only the pages they need for a particular passage, rather than carrying voluminous, expensive and bulky books. So why not carry the Almanac on you smartphone? Not only you do away with those bulky/expensive books (the trees thank you), but you also eliminate the errors associated with table lookup and interpolation (good-by, d and v!)

The same can be said of calculating the computed altitude from the ephemeris and an Assumed Position, except that all you really need for that is a $14.95 solar-powered scientific calculator (so “running out of batteries” is no longer an excuse to tote along various volumes of Pub. 229) and enough brain cells to memorize “sin(Hc) = sin(lat) sin(dec) + cos(lat) cos(dec) cos(LHA)” (O.K., O.K., and also “cos(Z) = (cos(lat) sin(dec) – sin(lat) cos(dec) cos(LHA))/cos(Hc)”… but I still think that is A LOT easier than using the silly and error-prone integer-degree assumed positions required by Pub. 229.)

If your smartphone is an Apple iPhone, the iTunes store has several “Apps” that will do all the work for you: Sacha Trosheit’s AstroNav, Navimatic’s Celestial, Luis Soltero’s StarPilot, Brian Johnson’s ezSights, Llamedos Software’s Ocean Navigator and dpfc Software’s iMariner just to name a few. I own a copy of most if not all of them. Some of these have quite amazing features, such as AstroNav’s built-in sextant that uses the iPhone’s accelerometers to determine the local vertical without the need for a horizon (I’m building a telescope/sunscope adaptor for my iPhone so I can measure how good this scheme is…)

So why YACNA (Yet Another Celestial Navigation App?) The answer is that I wanted something that would HELP me do celestial nav rather than DO IT FOR ME. Something that I could use to remove the tedium from ephemeris-finding and sight reduction while allowing me the joy of actually doing it. Also, I wanted to find out if I had learned enough of the stuff to write a program to do it.

So here is what I came up with – CNCalc, a calculator that supports celestial navigation. You still have to do it – which means you will be responsible for its accuracy and its errors, the very function humans are best at (not adding numbers…) Also, I implemented it as a “webApp”, that is, a Web page designed to be stored locally in you “device” so that, while originally a Web thingy, you do not need an active web connection to use it, only to download it the first time. Also, it should be useable by any device that has a Web browser, not just one model of smartphone or tablet. Why, you can even use it on your desktop PC if you have one in your boat! (Recent update and caveat: users have told me that I used some Apple-exclusive formats so this app does not display correctly on some devices. I promise to fix this SOMETIME...)

And, finally, it’s free. I make it available under the “GNU General Public License”, which is a legal device that deters (a good lawyer will say you never can “prevent”) an unscrupulous person from hijack publicly-available software, slap a copyright on it, and charge people – even the original programmer – for using it!

How

This is a “Web App”. What this means is that it looks like, and it is accessed like, a Web Page. But unlike a Web page, all the calculations are performed in the user’s machine, and all the required data is downloaded to the user’s machine, so that the “page” can be used Offline, that is, without an Internet connection. All you need to do is NOT to delete that page from your browser.

The URL for CNCalc, as of the time this is written, is aelias.net/cncalc.html.

iPhone/iPad users can use an additional feature: with CNCalc displayed on the iPhone’s Safari browser, tap the “forward to” icon at the bottom of the screen (looks like a rectangle with an arrow jutting out of it towards its right) then select the “Add to Home Screen” option. An icon looking like a sextant in front of a world globe will magically appear on your iPhone’s “desktop”, behaving very much like an App: even if you have deleted the CNCalc page from Safari, clicking that icon will make the page appear (although without the Safari stuff – it will seem to be a program of its own.)

This allows you to use CNCalc without begin connected to the ‘net. However, I will try to periodically update and bug-fix CNCalc, so you may want to consider periodically accessing the site with your browser, overriding the local copy you may have on your device.

Fair winds (and clear skies),

Antonio Elias

P.S. - Technical Details


Sight Reduction:


Watch Error Calculation:
General:

This code is based upon formulas published in Astronomical Algorithms by Jean Meeus and Textbook on Spherical Astronomy by W. M. Smart as first implemented in a series of javascript modules created and generously made available by Dr. Henning Umland. For this, and for his incomparable text on celestial navigation the author is forever grateful; Danke Herr Doktor!

Lunar distances (the angular separation between the center of the Moon and a chosen star) have been used in the past to estimate Greenwich time. Stars should be chosen so that they are within measurable distance to the Moon but not too close as to be obscured by the Moon's bloom. Also, the rate of change of the lunar distance should be as high as possible. This can be checked by calculating the lunar distance at times x and, say, x + 1h. This favors stars in the vicinity of the ecliptic.

Errors in ΔT = 32.184s + (TAI−UTC)−DUT1 have a significant influence only on the coordinates of the Moon. The program selects an approximate value of ΔT for each year from 1657 to 2019. These are very rough approximations: ΔT changes somewhat during the year, e.g. for 2014 the January value was 67.2810 and the December value was 67.6070; more significant is the whole leap second planned to be added at the end of June 2015. Current values for TAI−UTC and DUT1 (= UT1−UTC) are published on the web site of the IERS Rapid Service Prediction Center (IERS Bulletin A.)

Accuracy (approximate values):

GHA, SHA, Dec of Sun:±1"
GHA, SHA of Moon:   ±10"
Dec of Moon:   ±4"
GHA, SHA of 57 stars:±0.1"
GHA, DEC of Polaris:±1.5"
Dec of all stars:±0.1"
GHA of Aries:   ±0.1"
HP and SD:±0.1"
Lunar distances:±10"

Updates:

V1.01 - Fixed overload of Java Math.trunc function that caused errors in Chrome and Safari

License:

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the license or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License (http://www.gnu.org/licenses/) for more details.

Antonio Elias    N 38° 56.213'   W 077° 13.107'
Henning Umland    N 53° 20' 34"   E 009° 52' 00"