#ifndef _SG_GEODESY_HXX
#define _SG_GEODESY_HXX
-#include <simgear/math/point3d.hxx>
#include "SGMath.hxx"
// Compatibility header.
*alt = geod.getElevationM();
}
-/**
- * Convert a cartesian point to a geodetic lat/lon/altitude.
- * Alternate form using Point3D objects.
- *
- * @param cartesian point
- * @return geodetic point
- */
-inline Point3D sgCartToGeod(const Point3D& p)
-{
- SGGeod geod;
- SGGeodesy::SGCartToGeod(SGVec3<double>(p.x(), p.y(), p.z()), geod);
- return Point3D::fromSGGeod(geod);
-}
-
-
/**
* Convert a geodetic lat/lon/altitude to a cartesian point.
*
xyz[2] = cart(2);
}
-/**
- * Convert a geodetic lat/lon/altitude to a cartesian point.
- * Alternate form using Point3D objects.
- *
- * @param geodetic point
- * @return cartesian point
- */
-inline Point3D sgGeodToCart(const Point3D& geod)
-{
- SGVec3<double> cart;
- SGGeodesy::SGGeodToCart(SGGeod::fromRadM(geod.lon(), geod.lat(), geod.elev()), cart);
- return Point3D::fromSGVec3(cart);
-}
-
/**
* Given a starting position and an offset radial and distance,
* calculate an ending positon on a wgs84 ellipsoid.