Actually, as you pointed out, a rhumb line is the straight line, but if you follow a constant bearing (eg, make sure that you are heading 20deg at all times) then you will not be following a straight line (although it's all relative to the projection you use) because of the curvature of the earth (hence the great circle calculations). You say that the seafaring norm is to just us the rhumb line - I wasn't aware of that (but have confirmed it); however we will need to provide both options since, apparently, some people still do use the great circle calculation.
Thanks for the rhumb line calculation - I will try it later and see if it works. As it turns out, it's the calculation that I was after anyway - I mistakenly asked for the wrong formula. Rhumb line *is* what I want. I was going to implement the great circle bearing version with incremental rumb line segments. I'll let you know if the formula checks out. Cheers, Phil. ----- Original Message ----- From: "Phil Scadden" <[EMAIL PROTECTED]> To: "NZ Borland Developers Group - Delphi List" <[EMAIL PROTECTED]> Sent: Wednesday, April 21, 2004 4:27 PM Subject: Re: Fw: [DUG] Converting some code from C > > BTW, since this seems to be an area that you have expertise in, do you > > happen to have a formula to calculate an end point (lat, long) given a start > > point, distance and initial bearing? But here's the catch, not using a flat > > projection (ie, cartesian coordinates), instead, using the reverse of the > > great-circle bearing calculation (takes a start and end point and gives > > initial bearing)? I have the great-circle bearing calculation (I'll post it > > if you want), but it is just a tad too complex for me to reverse. > > Ah the joys of spherical/ellipsoidal maths. There is a catch here. If you > start at an original point and then follow a constant bearing, you will NOT > be following a great circle but a rhumb line. The great circle maths wont > give you the right answer. I have calculator but not source at hand to > do this. I would think that abundant examples on net because rhumb line > navigation is seafaring norm. > > >From quick look at trig, the formula should be > lat0, lon0, is start point in radians, T is true course (Angle between > course and local meridian measured clockwise in radians. D is distance in > metres. > > A := pi/10800 * D/1852 ; (convert distance to radians - more later) > Lat := lat0 + A*cos(T); > phid := log(tan(lat/2+pi/4)/tan(lat0/2+pi/4)); > IF (abs(lat-lat0) < sqrt(TOL)) then > q :=cos(lat0) > ELSE > q := (lat-lat0)/ phid; > > lond := -A*sin(T)/q; > lon :=mod(lon0+lond+pi,2*pi)-pi; > > Totally untested. On the ellispoid however, the conversion from > Distance to radians is more complicated. Real navigation gets away > with some rough approximations. It all depends on your errors (like how are > you measuring D say ) and acceptable tolerances. I don't feel like trying > for the precise ellispoidal formula from scratch but is probably around on > the net. > > ---------------------------------------------------------- > Phil Scadden, Institute of Geological and Nuclear Sciences > 764 Cumberland St, Private Bag 1930, Dunedin, New Zealand > Ph +64 3 4799663, fax +64 3 477 5232 > > _______________________________________________ > Delphi mailing list > [EMAIL PROTECTED] > http://ns3.123.co.nz/mailman/listinfo/delphi > _______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi
