Add convenience function to keep position with just an other elevation.
Modified Files: simgear/math/SGGeod.hxx
This commit is contained in:
@@ -42,6 +42,10 @@ public:
|
|||||||
static SGGeod fromRadM(double lon, double lat, double elevation);
|
static SGGeod fromRadM(double lon, double lat, double elevation);
|
||||||
/// Factory from angular values in degrees and elevation in m
|
/// Factory from angular values in degrees and elevation in m
|
||||||
static SGGeod fromDegM(double lon, double lat, double elevation);
|
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
|
/// Factory to convert position from a cartesian position assumed to be
|
||||||
/// in wgs84 measured in meters
|
/// in wgs84 measured in meters
|
||||||
/// Note that this conversion is relatively expensive to compute
|
/// Note that this conversion is relatively expensive to compute
|
||||||
@@ -192,6 +196,20 @@ SGGeod::fromDegM(double lon, double lat, double elevation)
|
|||||||
#endif
|
#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
|
inline
|
||||||
SGGeod
|
SGGeod
|
||||||
SGGeod::fromCart(const SGVec3<double>& cart)
|
SGGeod::fromCart(const SGVec3<double>& cart)
|
||||||
|
|||||||
Reference in New Issue
Block a user