diff --git a/simgear/math/SGGeod.hxx b/simgear/math/SGGeod.hxx index 89461db8..ca614e67 100644 --- a/simgear/math/SGGeod.hxx +++ b/simgear/math/SGGeod.hxx @@ -29,6 +29,13 @@ public: /// Default constructor, initializes the instance to lat = lon = elev = 0 SGGeod(void); + /** + return an SGGeod for which isValid() returns false. + This is necessaerby becuase for historical reasons, ther defaulrt constructor above initialsies to zero,zero,zero + which *is* + */ + static SGGeod invalid(); + /// Factory from angular values in radians and elevation is 0 static SGGeod fromRad(double lon, double lat); /// Factory from angular values in degrees and elevation is 0 diff --git a/simgear/math/SGGeodesy.cxx b/simgear/math/SGGeodesy.cxx index 6949a526..d7d5a0a5 100644 --- a/simgear/math/SGGeodesy.cxx +++ b/simgear/math/SGGeodesy.cxx @@ -663,3 +663,8 @@ SGGeodesy::radialIntersection(const SGGeod& a, double aRadial, result = SGGeod::fromGeoc(r); return true; } + +SGGeod SGGeod::invalid() +{ + return SGGeod::fromDeg(-999.9, -999.0); +}