polar3d.hxx File Reference

Routines to deal with polar math and transformations. More...

#include <simgear/constants.h>
#include <simgear/math/point3d.hxx>
#include "SGMath.hxx"

Go to the source code of this file.

Functions

double sgGeodAltFromCart (const Point3D &p)
 Find the Altitude above the Ellipsoid (WGS84) given the Earth Centered Cartesian coordinate vector Distances are specified in meters.
Point3D sgPolarToCart3d (const Point3D &p)
 Convert a polar coordinate to a cartesian coordinate.
Point3D sgCartToPolar3d (const Point3D &p)
 Convert a cartesian coordinate to polar coordinates (lon/lat specified in radians.
Point3D calc_gc_lon_lat (const Point3D &orig, double course, double dist)
 Calculate new lon/lat given starting lon/lat, and offset radial, and distance.
void calc_gc_course_dist (const Point3D &start, const Point3D &dest, double *course, double *dist)
 Calculate course/dist given two spherical points.


Detailed Description

Routines to deal with polar math and transformations.

Definition in file polar3d.hxx.


Function Documentation

void calc_gc_course_dist ( const Point3D start,
const Point3D dest,
double *  course,
double *  dist 
)

Calculate course/dist given two spherical points.

Parameters:
start starting point
dest ending point
course resulting course
dist resulting distance

Definition at line 81 of file polar3d.cxx.

References SG_EPSILON, SG_NM_TO_METER, SG_RAD_TO_NM, SGD_2PI, Point3D::x(), and Point3D::y().

Point3D calc_gc_lon_lat ( const Point3D orig,
double  course,
double  dist 
)

Calculate new lon/lat given starting lon/lat, and offset radial, and distance.

NOTE: starting point is specifed in radians, distance is specified in meters (and converted internally to radians) ... assumes a spherical world.

Parameters:
orig specified in polar coordinates
course offset radial
dist offset distance
Returns:
destination point in polar coordinates

Definition at line 43 of file polar3d.cxx.

References Point3D::setx(), Point3D::sety(), SG_EPSILON, SG_METER_TO_NM, SG_NM_TO_RAD, SGD_2PI, Point3D::x(), and Point3D::y().

Point3D sgCartToPolar3d ( const Point3D p  )  [inline]

Convert a cartesian coordinate to polar coordinates (lon/lat specified in radians.

Distances are specified in meters.

Parameters:
cp point specified in cartesian coordinates
Returns:
the same point in polar coordinates

Definition at line 77 of file polar3d.hxx.

References Point3D::fromSGGeoc(), SGGeodesy::SGCartToGeoc(), Point3D::x(), Point3D::y(), and Point3D::z().

double sgGeodAltFromCart ( const Point3D p  )  [inline]

Find the Altitude above the Ellipsoid (WGS84) given the Earth Centered Cartesian coordinate vector Distances are specified in meters.

Parameters:
cp point specified in cartesian coordinates
Returns:
altitude above the (wgs84) earth in meters

Definition at line 48 of file polar3d.hxx.

References SGGeod::getElevationM(), SGGeodesy::SGCartToGeod(), Point3D::x(), Point3D::y(), and Point3D::z().

Point3D sgPolarToCart3d ( const Point3D p  )  [inline]

Convert a polar coordinate to a cartesian coordinate.

Lon and Lat must be specified in radians. The SG convention is for distances to be specified in meters

Parameters:
p point specified in polar coordinates
Returns:
the same point in cartesian coordinates

Definition at line 63 of file polar3d.hxx.

References SGGeoc::fromRadM(), Point3D::fromSGVec3(), Point3D::lat(), Point3D::lon(), Point3D::radius(), and SGGeodesy::SGGeocToCart().


Generated on Mon Dec 17 09:30:56 2007 for SimGear by  doxygen 1.5.1