Add convenience function to keep position with just an other elevation.

Modified Files:
	simgear/math/SGGeod.hxx
This commit is contained in:
frohlich
2009-03-07 11:10:57 +00:00
committed by Tim Moore
parent fa20363853
commit 06ad73f85b

View File

@@ -42,6 +42,10 @@ public:
static SGGeod fromRadM(double lon, double lat, double elevation);
/// Factory from angular values in degrees and elevation in m
static SGGeod fromDegM(double lon, double lat, double elevation);
/// Factory from an other SGGeod and a different elevation in m
static SGGeod fromGeodM(const SGGeod& geod, double elevation);
/// Factory from an other SGGeod and a different elevation in ft
static SGGeod fromGeodFt(const SGGeod& geod, double elevation);
/// Factory to convert position from a cartesian position assumed to be
/// in wgs84 measured in meters
/// Note that this conversion is relatively expensive to compute
@@ -192,6 +196,20 @@ SGGeod::fromDegM(double lon, double lat, double elevation)
#endif
}
inline
SGGeod
SGGeod::fromGeodM(const SGGeod& geod, double elevation)
{
return SGGeod(geod._lon, geod._lat, elevation);
}
inline
SGGeod
SGGeod::fromGeodFt(const SGGeod& geod, double elevation)
{
return SGGeod(geod._lon, geod._lat, elevation*SG_FEET_TO_METER);
}
inline
SGGeod
SGGeod::fromCart(const SGVec3<double>& cart)