GeographicLib: GeographicLib::Gnomonic Class Reference (original) (raw)

Gnomonic projection

Gnomonic projection centered at an arbitrary position C on the ellipsoid. This projection is derived in Section 8 of

The projection of P is defined as follows: compute the geodesic line from C to P; compute the reduced length m12, geodesic scale M12, and ρ = m12/M12; finally x = ρ sin azi1; y = ρ cos azi1, where azi1 is the azimuth of the geodesic at C. The Gnomonic::Forward and Gnomonic::Reverse methods also return the azimuth azi of the geodesic at P and reciprocal scale rk in the azimuthal direction. The scale in the radial direction if 1/_rk_2.

For a sphere, ρ is reduces to a tan(s12/a), where s12 is the length of the geodesic from C to P, and the gnomonic projection has the property that all geodesics appear as straight lines. For an ellipsoid, this property holds only for geodesics interesting the centers. However geodesic segments close to the center are approximately straight.

Consider a geodesic segment of length l. Let T be the point on the geodesic (extended if necessary) closest to C the center of the projection and t be the distance CT. To lowest order, the maximum deviation (as a true distance) of the corresponding gnomonic line segment (i.e., with the same end points) from the geodesic is

(K(T) - K(C)) _l_2 t / 32.

where K is the Gaussian curvature.

This result applies for any surface. For an ellipsoid of revolution, consider all geodesics whose end points are within a distance r of C. For a given r, the deviation is maximum when the latitude of C is 45°, when endpoints are a distance r away, and when their azimuths from the center are ± 45° or ± 135°. To lowest order in r and the flattening f, the deviation is f (r/2_a_)3 r.

The conversions all take place using a Geodesic object (by default Geodesic::WGS84()). For more information on geodesics see Geodesics on an ellipsoid of revolution.

Warning

The definition of this projection for a sphere is standard. However, there is no standard for how it should be extended to an ellipsoid. The choices are:

Example of use:

#include

#include

using namespace std;

try {

Geodesic geod(Constants::WGS84_a(), Constants::WGS84_f());

const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0;

{

double lat = 50.9, lon = 1.8;

double x, y;

proj.Forward(lat0, lon0, lat, lon, x, y);

cout << x << " " << y << "\n";

}

{

double x = -38e3, y = 230e3;

double lat, lon;

proj.Reverse(lat0, lon0, x, y, lat, lon);

cout << lat << " " << lon << "\n";

}

}

catch (const exception& e) {

cerr << "Caught exception: " << e.what() << "\n";

return 1;

}

}

int main(int argc, const char *const argv[])

Header for GeographicLib::Geodesic class.

Header for GeographicLib::Gnomonic class.

Namespace for GeographicLib.

GeodesicProj is a command-line utility providing access to the functionality of AzimuthalEquidistant, Gnomonic, and CassiniSoldner.

Definition at line 102 of file Gnomonic.hpp.