NavList:
A Community Devoted to the Preservation and Practice of Celestial Navigation and Other Methods of Traditional Wayfinding
Re: Destination from course and distance
From: George Huxtable
Date: 2005 Mar 9, 23:29 +0000
From: George Huxtable
Date: 2005 Mar 9, 23:29 +0000
Jeff Schroeder asked, on 17 Feb.- >Can someone point me to spherical trig (great circle sailing) formulas >for determining destination Lat & Lon, if given departure Lat & Lon, >true course, and distance travelled? > >I have made stabs at trying to flip around the cel nav Hc and Zn >formulas into what I'm looking for, but must admit the weakness of my >math skills. I can't figure out how to get Lat & Lon out of it without >already knowing one or the other. ================= Jeff's question is beguilingly simple, but invites some further questions. He specifies great circle sailing, but then specifies "true course". And, of course, in great circle sailing, there's no "true course"; the course has to be adjusted all the time to keep to the great circle. What can be specified is the "initial course" that you start off with. The question Jeff hasn't asked yet (but will need to ask next), if he actually plans to steer such a great-circle path, is what adjustments need to be made to his course as the voyage proceeds. It would be helpful if Jeff were to explain more clearly what he has in mind. Peter Fogg has replied on 19 Feb as follows- >It seems to me that there is a trade-off between simplicity and accuracy, >and in the end the user has to decide which method is appropriate. > >The simplest method is to measure on the chart, and this may well be >accurate enough for many practical purposes. > >Next (less simple) is possibly Plane Sailing, followed by methods like Mid >Lat. > >The most accurate method uses both Meridional parts and Meridional >differences. This takes account of the irregularities in the spherical-like >shape of the earth. Using Meridional tables and (relatively) simple >formulae, this method is quite easy to get used to using. > >But this method is still not entirely accurate, as the mathematical models >it uses can never be exactly the same as the irregularities in the earth's >shape. > >This doesn't matter much, for most navigational purposes. However, not one of the solutions Peter offers tackles the problem Jeff asked about: that of great-circle sailing. In each case, Peter deals with a rhumb-line track, steering with constant course. Next, Paul Hirose, in two postings, 17 and 20 Feb, has drawn the analogy with calculation of altitude and azimuth of a celestial triangle, and showed, rather cleverly, how precomputed tables can be used to obtain the quantities Jeff was after. However, even that has not actually answered Jeff's question, which asked for a FORMULA to give the lat and long of his destination. Perhaps he wishes to incorporate it into a program of some sort. Doug Royer has pointed to great-circle formulae provided in Bowditch. In my 2-vol edition, these are in the second vol (1981), pages 603 to 613 (art. 1016, "Great circle sailing by computation", to 1018). However, Bowditch tends to use two-step formulae, which first require the position of the vertex to be calculated. The vertex is the point on a great-circle track (or on a track suitably extended) which comes nearest to a Pole. Other formulae in Bowditch are unhelpfully expressed in terms of haversines, not usually available to a computer. So I've had a go at filling the gap, and providing formulae for great-circle destination which are readily implemented in a computer program, as follows- ===================== To find the destination, lat2 and long2, after leaving the departure point lat1, long1, initially starting in the direction course1, and travelling a distance m nautical miles. Conventions: (it's useful to specify these very clearly) ----------- All angles are expressed in degrees, so the computer must calculate in degrees rather than radians (or convert). lat1 and lat2 are positive for North, negative for South. Courses are in degrees clockwise, 0 to 360 from true North. The initial course is course1. Longitudes are always measured in degrees Westwards from Greenwich (which I refer to as "Westitude" to emphasise that convention) and similarly changes in longitude are measured Westwards (which I call "Westing"). An Easterly long. from Greenwich of, say 10 degrees E, can be expressed as a Westitude of 350 deg, or of -10 deg, which is exactly the same thing. Let's start- d = miles / 60 (this puts the great-circle distance into degrees) then, for the resulting latitude lat2 : lat2 = ASN ( (COS d * SIN lat1) + (SIN d * COS lat1 * COS course1)) and for the westing w : x = SIN d * SIN course1 IF x = 0 THEN w = 90 * (1 - SGN (cos d)) (this traps out infinities) ELSE w = 180 + (90 * SGN x) - ATN(((SIN lat1 * COS course1) - (TAN (90 - D) * COS lat1)) / SIN course1) ENDIF This gives the Westing as an angle w, 0 to 360 degrees, to add to the initial Westitude long1, to give the resulting Westitude long2. If the sum exceeds 360, subtract 360. ================= Two factors make the above bit of code somewhat more complicated than you would initially expect- 1. The ATN (arc-tan or inverse tan) function provides an angle always in the range -90 to +90, whereas the result is needed in the correct quadrant 0 to +360 degrees. Perhaps, if the function, usually named POL or ATAN2, and used for conversion to polar coordinates, is available, then the code could be simplified, because that function automatically chooses the quadrant. 2. Under some circumstances ( if D = 0 or course1 = 0) then an infinity arises part way though the calculation, which may cause an upset. Those special cases are therefore trapped out beforehand. On test, the above expressions appear to give the right answers. However, I usually prefer to subject such code to more prolonged use before offering it; which hasn't happened in this case. So it's somewhat tentative: if anyone sees any snags or finds any errors or suggests any improvements then I hope they will be posted to Nav-l. =================== The next step that's needed is the one that Jeff Schroeder didn't ask for, but perhaps should have; the final course that should be being-steered at the end of a great-circle leg of a voyage. Here, I presume that a long great-circle path has been split up into legs, where the legs join smoothly together. The final course of a leg is useful for two reasons- 1. It gives a clue as to how a vessel's course should be gradually adjusted over each great-circle leg of a voyage. from the initial-course to the final-course. This is useful only if legs are kept reasonably short, say a thousand miles or so. 2. The final course at the end of a leg becomes the initial course at the start of the next leg, and the starting position for that next leg is the calculated lat and long resulting from the first leg. In this way a series of waypoints and courses can be readily established along a smooth and continuous great-circle path. Perhaps someone else would like to have a go at that problem; finding the appropriate value for course2 at the end of a great-circle leg of m miles, setting off in a direction course1 from a position lat1, long1. It's a straightforward exercise in spherical geometry (I think). George. ================================================================ contact George Huxtable by email at george@huxtable.u-net.com, by phone at 01865 820222 (from outside UK, +44 1865 820222), or by mail at 1 Sandy Lane, Southmoor, Abingdon, Oxon OX13 5HX, UK. ================================================================