# NavList:

## A Community Devoted to the Preservation and Practice of Celestial Navigation and Other Methods of Traditional Wayfinding

**Re: Azimuth Equation**

**From:**George Huxtable

**Date:**2005 Oct 19, 21:42 +0100

Todd Shanklin wrote- I've been recently programming a TI-81 Calculator to do my sight reductions. Everything has been going swimmingly, getting closer and closer with my sights and shooting more stars- until the past week or so when the LHA of Altair at twilight became closer to 360 degrees. With all my fiddling, I've narrowed the problem and any accompanying possibly useful troubleshooting information down to this: The calculator will find Hc, but when it tries to calculate the azimuth, it sends back the error message "Math 04 Error". When I enter the equation and values manually as one equation I get the same message after pressing enter. Strangely it seems, I have found that when the Declination is South (that is- the dec value is negative) the error message does not occur and calculator works just fine. The error message only shows up when the LHA is 345 degrees or greater. I'm using the azimuth equation out of the Nautical Almanac: cos-1[(sinDec cosLat)-(cosDec cosLHA sinLat)/cosHc] To find Hc: sin-1[(sinDec sinLat)+(cosDec cosLHA cos Lat)] In entering the equation, if the Declination or latitude is South, or the Longitude is West, the value is negative. I am unable to figure this out; I've reached the end of my mathematical tether at this point. When I work it out manually one step at a time everything works out fine (e.g. calculate the sin Dec*cosLat, save that value, calc. cos Dec*cosLHA...) Does anyone have any clue as to why this is happening? Like I said, I had no problems whatsoever until the LHA began to approach >345 degrees. One example from my recent sights during which the problem occured: Altair-10/13/05- 0157:28 GMT LHA= 349.9983333 Dec= N8.885 Lat=N38.563 Todd Shanklin ============================== From George: There seems to be a problem here with the bracketing. The Nautical almanac defines the angle A as arc cos (inverse cos; same meaning as cos-1) of X, where X = (sin dec cos lat - cos dec cos LHA sin lat) / cos Hc. This is different from the way Todd has written the expression for X, as- X= [(sinDec cosLat)-(cosDec cosLHA sinLat)/cosHc] In the first case, cos Hc divides the whole expression; as it should. In the second case, it divides only the second term. That's true in most notations, but my memories of TI machines are very distant ones. You would get the wrong answer in the second case. However, for the numbers that Todd quotes, I think you should get some sort of answer in each case, not a refusal. I don't know why Todd's calculator refuses when it comes to the jump. There's only a limited range of LHA that will give a valid answer, with azimuth in the range 0 to 180. If the machine tries to calculate an angle from its cos, when that cos is outside the range -1 to +1, it will balk. If Hc has been correctly calculated according to the formula Hc = sin-1[(sinDec sinLat)+(cosDec cosLHA cos Lat)] as Todd quotes, then cos A should not be outside the allowed range. But (of course) one isn't allowed to tinker with any of the quantities Dec, Lat, LHA, in the equation for A, without first recalculating the new value for Hc. Yes, there's another way (and I think a better one) of calculating azimuth using an arc tan formula, but the arc cos formula, as in the Nautical Almanac, ought to work, so the first priority is to discover why it isn't doing so, for Todd. It might be helpful if he tells us his deduced value for Hc. I think he will find that somewhere his programmed expression differs from what was intended, in some additional way beside the error explained above. George. =================================