Public Member Functions
GeographicLib::LocalCartesian Class Reference

Local Cartesian coordinates. More...

#include <GeographicLib/LocalCartesian.hpp>

List of all members.

Public Member Functions

 LocalCartesian (double lat0, double lon0, double h0=0, const Geocentric &earth=Geocentric::WGS84) throw ()
 LocalCartesian (const Geocentric &earth=Geocentric::WGS84) throw ()
void Reset (double lat0, double lon0, double h0=0) throw ()
void Forward (double lat, double lon, double h, double &x, double &y, double &z) const throw ()
void Reverse (double x, double y, double z, double &lat, double &lon, double &h) const throw ()
double LatitudeOrigin () const throw ()
double LongitudeOrigin () const throw ()
double HeightOrigin () const throw ()

Detailed Description

Local Cartesian coordinates.

Convert between geodetic coordinates latitude = lat, longitude = lon, height = h (measured vertically from the surface of the ellipsoid) to local cartesian coordinates (x, y, z). The origin of local cartesian coordinate system is at lat = lat0, lon = lon0, h = h0. The z axis is normal to the ellipsoid; the y axis points due north. The plane z = - h0 is tangent to the ellipsoid.

The conversions all take place via geocentric coordinates using a GeographicLib::GeoCentric object (by default GeographicLib::Geocentric::WGS84).


Constructor & Destructor Documentation

GeographicLib::LocalCartesian::LocalCartesian ( double  lat0,
double  lon0,
double  h0 = 0,
const Geocentric earth = Geocentric::WGS84 
) throw () [inline]

Constructor setting the origin to latitude = lat0, longitude = lon0 (degrees), height = h0 (meters). The optional earth argument (default Geocentric::WGS84) specifies the Geocentric object to use for the transformation.

Definition at line 47 of file LocalCartesian.hpp.

References Reset().

GeographicLib::LocalCartesian::LocalCartesian ( const Geocentric earth = Geocentric::WGS84) throw () [inline]

Default constructor sets the origin to lat0 = 0, lon0 = 0, h0 = 0. The optional earth argument (default Geocentric::WGS84) specifies the Geocentric object to use for the transformation.

Definition at line 57 of file LocalCartesian.hpp.

References Reset().


Member Function Documentation

void GeographicLib::LocalCartesian::Reset ( double  lat0,
double  lon0,
double  h0 = 0 
) throw ()

Change the origin to latitude = lat0, longitude = lon0 (degrees), height = h0 (meters).

Definition at line 23 of file LocalCartesian.cpp.

References GeographicLib::Constants::degree().

Referenced by LocalCartesian().

void GeographicLib::LocalCartesian::Forward ( double  lat,
double  lon,
double  h,
double &  x,
double &  y,
double &  z 
) const throw ()

Convert from geodetic coordinates lat, lon (degrees), h (meters) to local cartesian coordinates x, y, z (meters). lat should be in the range [-90, 90]; lon and lon0 should be in the range [-180, 360].

Definition at line 43 of file LocalCartesian.cpp.

Referenced by main().

void GeographicLib::LocalCartesian::Reverse ( double  x,
double  y,
double  z,
double &  lat,
double &  lon,
double &  h 
) const throw ()

Convert from local cartesian x, y, z (meters) to geodetic coordinates lat, lon (degrees), h (meters). The value of lon returned is in the range [-180, 180).

Definition at line 53 of file LocalCartesian.cpp.

Referenced by main().

double GeographicLib::LocalCartesian::LatitudeOrigin ( ) const throw () [inline]

Return the latitude of the origin (degrees).

Definition at line 87 of file LocalCartesian.hpp.

double GeographicLib::LocalCartesian::LongitudeOrigin ( ) const throw () [inline]

Return the longitude of the origin (degrees).

Definition at line 92 of file LocalCartesian.hpp.

double GeographicLib::LocalCartesian::HeightOrigin ( ) const throw () [inline]

Return the height of the origin (meters).

Definition at line 97 of file LocalCartesian.hpp.


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