[Proj] Program Geod

Karney, Charles ckarney at Sarnoff.com
Tue Mar 17 14:11:47 PDT 2009


> I noticed a factor with Karney's geodesic program Geod where the
> azimuth of the geodesic at point 2, usually referred to as the "back
> azimuth", pointed away from the first point.  That is, it is off by
> Pi.

The documentation of the Geodesic class specifies

    'azi2 is the "forward" azimuth, i.e., the heading that takes you
    beyond point 2 not back to point 1.'

I'll fix it so that the help printed with Geod -h includes this
definition.

I'm in good company using the forward azimuth at the second point.  This
is the convention used by Rainsford, Vincenty, and Rapp.  I prefer this
choice because when solving the direct problem with a negative distance,
the meaning of both azi1 and azi2 remain the same (they are the heading
in the +s direction).

If you want to change the output, then edit Geod.cpp, changing

   AzimuthString(azi2, prec, dms);

to

   AzimuthString(azi2 + 180, prec, dms);

wherever it occurs.  (AzimuthString folds the result to [0,360).)

--
Charles Karney <ckarney at sarnoff.com>
Sarnoff Corporation, Princeton, NJ 08543-5300

URL: http://charles.karney.info
Tel: +1 609 734 2312
Fax: +1 609 734 2662



More information about the Proj mailing list