]> git.mxchange.org Git - simgear.git/blobdiff - simgear/math/SGGeod.hxx
Modified Files:
[simgear.git] / simgear / math / SGGeod.hxx
index 3fb6659b85163f0acafd69c1ce412d7b6b3d26de..50c6b97dac2fd4c82fbb9901de8c3e071aa073ee 100644 (file)
@@ -27,12 +27,6 @@ class SGGeod {
 public:
   /// Default constructor, initializes the instance to lat = lon = elev = 0
   SGGeod(void);
-  /// Initialize from a cartesian vector assumed to be in meters
-  /// Note that this conversion is relatively expensive to compute
-  SGGeod(const SGVec3<double>& cart);
-  /// Initialize from a geocentric position
-  /// Note that this conversion is relatively expensive to compute
-  SGGeod(const SGGeoc& geoc);
 
   /// Factory from angular values in radians and elevation is 0
   static SGGeod fromRad(double lon, double lat);
@@ -46,6 +40,13 @@ 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 to convert position from a cartesian position assumed to be
+  /// in wgs84 measured in meters
+  /// Note that this conversion is relatively expensive to compute
+  static SGGeod fromCart(const SGVec3<double>& cart);
+  /// Factory to convert position from a geocentric position
+  /// Note that this conversion is relatively expensive to compute
+  static SGGeod fromGeoc(const SGGeoc& geoc);
 
   /// Return the geodetic longitude in radians
   double getLongitudeRad(void) const;
@@ -107,20 +108,6 @@ SGGeod::SGGeod(double lon, double lat, double elevation) :
 {
 }
 
-inline
-SGGeod::SGGeod(const SGVec3<double>& cart)
-{
-  SGGeodesy::SGCartToGeod(cart, *this);
-}
-
-inline
-SGGeod::SGGeod(const SGGeoc& geoc)
-{
-  SGVec3<double> cart;
-  SGGeodesy::SGGeocToCart(geoc, cart);
-  SGGeodesy::SGCartToGeod(cart, *this);
-}
-
 inline
 SGGeod
 SGGeod::fromRad(double lon, double lat)
@@ -191,6 +178,26 @@ SGGeod::fromDegM(double lon, double lat, double elevation)
 #endif
 }
 
+inline
+SGGeod
+SGGeod::fromCart(const SGVec3<double>& cart)
+{
+  SGGeod geod;
+  SGGeodesy::SGCartToGeod(cart, geod);
+  return geod;
+}
+
+inline
+SGGeod
+SGGeod::fromGeoc(const SGGeoc& geoc)
+{
+  SGVec3<double> cart;
+  SGGeodesy::SGGeocToCart(geoc, cart);
+  SGGeod geod;
+  SGGeodesy::SGCartToGeod(cart, geod);
+  return geod;
+}
+
 inline
 double
 SGGeod::getLongitudeRad(void) const