GeographicLib 2.7

Loading...
Searching...
No Matches
GeographicLib::AzimuthalEquidistant Class Reference

Azimuthal equidistant projection. More...

`#include <GeographicLib/AzimuthalEquidistant.hpp>`

## Public Member Functions
| AzimuthalEquidistant (const Geodesic &earth=Geodesic::WGS84())
void | Forward (real lat0, real lon0, real lat, real lon, real &x, real &y, real &azi, real &rk) const
void | Reverse (real lat0, real lon0, real x, real y, real &lat, real &lon, real &azi, real &rk) const
void | Forward (real lat0, real lon0, real lat, real lon, real &x, real &y) const
void | Reverse (real lat0, real lon0, real x, real y, real &lat, real &lon) const
Inspector functions
Math::real | EquatorialRadius () const
Math::real | Flattening () const

## Detailed Description

Azimuthal equidistant projection.

Azimuthal equidistant projection centered at an arbitrary position on the ellipsoid. For a point in projected space (x, y), the geodesic distance from the center position is hypot(x, y) and the azimuth of the geodesic from the center point is atan2(x, y). The Forward and Reverse methods also return the azimuth azi of the geodesic at (x, y) and reciprocal scale rk in the azimuthal direction which, together with the basic properties of the projection, serve to specify completely the local affine transformation between geographic and projected coordinates.

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.

Example of use:

// Example of using the GeographicLib::AzimuthalEquidistant class
#include <iostream>
#include <exception>
#include <GeographicLib/Geodesic.hpp>
#include <GeographicLib/AzimuthalEquidistant.hpp>
using namespace std;
using namespace GeographicLib;
int main() {
try {
Geodesic geod(Constants::WGS84_a(), Constants::WGS84_f());
// Alternatively: const Geodesic& geod = Geodesic::WGS84();
const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0; // Paris
AzimuthalEquidistant proj(geod);
{
// Sample forward calculation
double lat = 50.9, lon = 1.8; // Calais
double x, y;
proj.Forward(lat0, lon0, lat, lon, x, y);
cout << x << " " << y << "\n";
}
{
// Sample reverse calculation
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;
}
}
AzimuthalEquidistant.hpp
Header for GeographicLib::AzimuthalEquidistant class.
main
int main(int argc, const char *const argv[])
Definition Cart3Convert.cpp:52
Geodesic.hpp
Header for GeographicLib::Geodesic class.
GeographicLib::AzimuthalEquidistant::AzimuthalEquidistant
AzimuthalEquidistant(const Geodesic &earth=Geodesic::WGS84())
Definition AzimuthalEquidistant.cpp:16
GeographicLib::Constants::WGS84_f
static T WGS84_f()
Definition Constants.hpp:118
GeographicLib::Constants::WGS84_a
static T WGS84_a()
Definition Constants.hpp:112
GeographicLib::Geodesic
Geodesic calculations
Definition Geodesic.hpp:175
GeographicLib
Namespace for GeographicLib.
Definition Accumulator.cpp:12
std
Definition NearestNeighbor.hpp:806

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

Definition at line 42 of file AzimuthalEquidistant.hpp.

## Constructor & Destructor Documentation

## ◆ AzimuthalEquidistant()

GeographicLib::AzimuthalEquidistant::AzimuthalEquidistant | ( | const Geodesic & | earth = Geodesic::WGS84() | ) |
| explicit

Constructor for AzimuthalEquidistant.

Parameters

  [in] | earth | the Geodesic object to use for geodesic calculations. By default this uses the WGS84 ellipsoid.

Definition at line 16 of file AzimuthalEquidistant.cpp.

## Member Function Documentation

## ◆ Forward() [1/2]

void GeographicLib::AzimuthalEquidistant::Forward | ( | real | lat0,
|  | real | lon0,
|  | real | lat,
|  | real | lon,
|  | real & | x,
|  | real & | y,
|  | real & | azi,
|  | real & | rk ) const

Forward projection, from geographic to azimuthal equidistant.

Parameters

  [in] | lat0 | latitude of center point of projection (degrees).
  [in] | lon0 | longitude of center point of projection (degrees).
  [in] | lat | latitude of point (degrees).
  [in] | lon | longitude of point (degrees).
  [out] | x | easting of point (meters).
  [out] | y | northing of point (meters).
  [out] | azi | azimuth of geodesic at point (degrees).
  [out] | rk | reciprocal of azimuthal scale at point.

lat0 and lat should be in the range [−90°, 90°]. The scale of the projection is 1 in the "radial" direction, azi clockwise from true north, and is 1/rk in the direction perpendicular to this. A call to Forward followed by a call to Reverse will return the original (lat, lon) (to within roundoff).

Definition at line 20 of file AzimuthalEquidistant.cpp.

References GeographicLib::Math::sincosd().

Referenced by Forward(), and main().

## ◆ Reverse() [1/2]

void GeographicLib::AzimuthalEquidistant::Reverse | ( | real | lat0,
|  | real | lon0,
|  | real | x,
|  | real | y,
|  | real & | lat,
|  | real & | lon,
|  | real & | azi,
|  | real & | rk ) const

Reverse projection, from azimuthal equidistant to geographic.

Parameters

  [in] | lat0 | latitude of center point of projection (degrees).
  [in] | lon0 | longitude of center point of projection (degrees).
  [in] | x | easting of point (meters).
  [in] | y | northing of point (meters).
  [out] | lat | latitude of point (degrees).
  [out] | lon | longitude of point (degrees).
  [out] | azi | azimuth of geodesic at point (degrees).
  [out] | rk | reciprocal of azimuthal scale at point.

lat0 should be in the range [−90°, 90°]. lat will be in the range [−90°, 90°] and lon will be in the range [−180°, 180°]. The scale of the projection is 1 in the "radial" direction, azi clockwise from true north, and is 1/rk in the direction perpendicular to this. A call to Reverse followed by a call to Forward will return the original (x, y) (to roundoff) only if the geodesic to (x, y) is a shortest path.

Definition at line 30 of file AzimuthalEquidistant.cpp.

References GeographicLib::Math::atan2d().

Referenced by main(), and Reverse().

## ◆ Forward() [2/2]

void GeographicLib::AzimuthalEquidistant::Forward | ( | real | lat0,
|  | real | lon0,
|  | real | lat,
|  | real | lon,
|  | real & | x,
|  | real & | y ) const
| inline

AzimuthalEquidistant::Forward without returning the azimuth and scale.

Definition at line 104 of file AzimuthalEquidistant.hpp.

References Forward().

## ◆ Reverse() [2/2]

void GeographicLib::AzimuthalEquidistant::Reverse | ( | real | lat0,
|  | real | lon0,
|  | real | x,
|  | real | y,
|  | real & | lat,
|  | real & | lon ) const
| inline

AzimuthalEquidistant::Reverse without returning the azimuth and scale.

Definition at line 113 of file AzimuthalEquidistant.hpp.

References Reverse().

## ◆ EquatorialRadius()

Math::real GeographicLib::AzimuthalEquidistant::EquatorialRadius | ( |  | ) | const
| inline

Returns
  a the equatorial radius of the ellipsoid (meters). This is the value inherited from the Geodesic object used in the constructor.

Definition at line 126 of file AzimuthalEquidistant.hpp.

## ◆ Flattening()

Math::real GeographicLib::AzimuthalEquidistant::Flattening | ( |  | ) | const
| inline

Returns
  f the flattening of the ellipsoid. This is the value inherited from the Geodesic object used in the constructor.

Definition at line 132 of file AzimuthalEquidistant.hpp.

The documentation for this class was generated from the following files:

- AzimuthalEquidistant.hpp
- AzimuthalEquidistant.cpp