Public Member Functions

GeographicLib::LocalCartesian Class Reference

Local Cartesian coordinates. More...

#include <GeographicLib/LocalCartesian.hpp>

List of all members.

Public Member Functions

 LocalCartesian (real lat0, real lon0, real h0=0, const Geocentric &earth=Geocentric::WGS84) throw ()
 LocalCartesian (const Geocentric &earth=Geocentric::WGS84) throw ()
void Reset (real lat0, real lon0, real h0=0) throw ()
void Forward (real lat, real lon, real h, real &x, real &y, real &z) const throw ()
void Forward (real lat, real lon, real h, real &x, real &y, real &z, std::vector< real > &M) const throw ()
void Reverse (real x, real y, real z, real &lat, real &lon, real &h) const throw ()
void Reverse (real x, real y, real z, real &lat, real &lon, real &h, std::vector< real > &M) const throw ()
Inspector functions

Math::real LatitudeOrigin () const throw ()
Math::real LongitudeOrigin () const throw ()
Math::real HeightOrigin () const throw ()
Math::real MajorRadius () const throw ()
Math::real InverseFlattening () 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 Geocentric object (by default Geocentric::WGS84).

Definition at line 32 of file LocalCartesian.hpp.


Constructor & Destructor Documentation

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

Constructor setting the origin.

Parameters:
[in] lat0 latitude at origin (degrees).
[in] lon0 longitude at origin (degrees).
[in] h0 height above ellipsoid at origin (meters); default 0.
[in] earth Geocentric object for the transformation; default Geocentric::WGS84.

Definition at line 55 of file LocalCartesian.hpp.

References Reset().

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

Default constructor.

Parameters:
[in] earth Geocentric object for the transformation; default Geocentric::WGS84.

Sets lat0 = 0, lon0 = 0, h0 = 0.

Definition at line 68 of file LocalCartesian.hpp.

References Reset().


Member Function Documentation

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

Reset the origin.

Parameters:
[in] lat0 latitude at origin (degrees).
[in] lon0 longitude at origin (degrees).
[in] h0 height above ellipsoid at origin (meters); default 0.

Definition at line 21 of file LocalCartesian.cpp.

Referenced by LocalCartesian().

void GeographicLib::LocalCartesian::Forward ( real  lat,
real  lon,
real  h,
real &  x,
real &  y,
real &  z 
) const throw () [inline]

Convert from geodetic to local cartesian coordinates.

Parameters:
[in] lat latitude of point (degrees).
[in] lon longitude of point (degrees).
[in] h height of point above the ellipsoid (meters).
[out] x local cartesian coordinate (meters).
[out] y local cartesian coordinate (meters).
[out] z local cartesian coordinate (meters).

lat should be in the range [-90, 90]; lon and lon0 should be in the range [-180, 360].

Definition at line 96 of file LocalCartesian.hpp.

void GeographicLib::LocalCartesian::Forward ( real  lat,
real  lon,
real  h,
real &  x,
real &  y,
real &  z,
std::vector< real > &  M 
) const throw () [inline]

Convert from geodetic to local cartesian coordinates and return rotation matrix.

Parameters:
[in] lat latitude of point (degrees).
[in] lon longitude of point (degrees).
[in] h height of point above the ellipsoid (meters).
[out] x local cartesian coordinate (meters).
[out] y local cartesian coordinate (meters).
[out] z local cartesian coordinate (meters).
[out] M if the length of the vector is 9, fill with the rotation matrix in row-major order.

Pre-multiplying a unit vector in local cartesian coordinates at (lat, lon, h) by M transforms the vector to local cartesian coordinates at (lat0, lon0, h0).

Definition at line 118 of file LocalCartesian.hpp.

void GeographicLib::LocalCartesian::Reverse ( real  x,
real  y,
real  z,
real &  lat,
real &  lon,
real &  h 
) const throw () [inline]

Convert from local cartesian to geodetic coordinates.

Parameters:
[in] x local cartesian coordinate (meters).
[in] y local cartesian coordinate (meters).
[in] z local cartesian coordinate (meters).
[out] lat latitude of point (degrees).
[out] lon longitude of point (degrees).
[out] h height of point above the ellipsoid (meters).

The value of lon returned is in the range [-180, 180).

Definition at line 139 of file LocalCartesian.hpp.

void GeographicLib::LocalCartesian::Reverse ( real  x,
real  y,
real  z,
real &  lat,
real &  lon,
real &  h,
std::vector< real > &  M 
) const throw () [inline]

Convert from local cartesian to geodetic coordinates and return rotation matrix.

Parameters:
[in] x local cartesian coordinate (meters).
[in] y local cartesian coordinate (meters).
[in] z local cartesian coordinate (meters).
[out] lat latitude of point (degrees).
[out] lon longitude of point (degrees).
[out] h height of point above the ellipsoid (meters).
[out] M if the length of the vector is 9, fill with the rotation matrix in row-major order.

Pre-multiplying a unit vector in local cartesian coordinates at (lat0, lon0, h0) by the transpose of M transforms the vector to local cartesian coordinates at (lat, lon, h).

Definition at line 161 of file LocalCartesian.hpp.

Math::real GeographicLib::LocalCartesian::LatitudeOrigin (  )  const throw () [inline]
Returns:
latitude of the origin (degrees).

Definition at line 176 of file LocalCartesian.hpp.

Math::real GeographicLib::LocalCartesian::LongitudeOrigin (  )  const throw () [inline]
Returns:
longitude of the origin (degrees).

Definition at line 181 of file LocalCartesian.hpp.

Math::real GeographicLib::LocalCartesian::HeightOrigin (  )  const throw () [inline]
Returns:
height of the origin (meters).

Definition at line 186 of file LocalCartesian.hpp.

Math::real GeographicLib::LocalCartesian::MajorRadius (  )  const throw () [inline]
Returns:
a the equatorial radius of the ellipsoid (meters). This is the value of a inherited from the Geocentric object used in the constructor.

Definition at line 193 of file LocalCartesian.hpp.

References GeographicLib::Geocentric::MajorRadius().

Math::real GeographicLib::LocalCartesian::InverseFlattening (  )  const throw () [inline]
Returns:
r the inverse flattening of the ellipsoid. This is the value of r inherited from the Geocentric object used in the constructor. A value of 0 is returned for a sphere (infinite inverse flattening).

Definition at line 201 of file LocalCartesian.hpp.

References GeographicLib::Geocentric::InverseFlattening().


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