00001 #ifndef PHX_GEOGRAPHIC_COORDINATES_H
00002 #define PHX_GEOGRAPHIC_COORDINATES_H
00003
00004 #include <Phx/Util/PhxMatrix.h>
00005
00006 namespace Phx {
00007 class EcefVector;
00008
00009 class GeographicEllipsoid {
00010 public:
00011 const static double WGS84_EQUATORIAL_RADIUS;
00012 const static double WGS84_ECCENTRICITY;
00013
00014 GeographicEllipsoid();
00015 GeographicEllipsoid(double e1, double a);
00016
00017 double eccentricity() const { return mEccentricity; }
00018 void eccentricity(double eccentricity);
00019 double equatorialRadius() const { return mEquatorialRadius; }
00020 void equatorialRadius(double equatorialRadius);
00021
00022 double polarRadius() const { return mPolarRadius; }
00023 double ellipticity() const { return mEllipticity; }
00024
00025 private:
00026 void updateAux(void);
00027
00028 double mEccentricity;
00029 double mEquatorialRadius;
00030 double mPolarRadius;
00031 double mEllipticity;
00032 };
00033
00034 class LlaVector {
00035 public:
00036 LlaVector() { }
00037 LlaVector(double lat, double lon, double alt) :
00038 mValue(lat, lon, alt) {}
00039
00040 double latitude() const { return mValue[0]; }
00041 void latitude(double latitude) { mValue[0] = latitude; }
00042
00043 double longitude() const { return mValue[1]; }
00044 void longitude(double longitude) { mValue[1] = longitude; }
00045
00046 double altitude() const { return mValue[2]; }
00047 void altitude(double altitude) { mValue[2] = altitude; }
00048
00049 EcefVector ecefVector(const GeographicEllipsoid& ellipse) const;
00050
00051 private:
00052 Vector3 mValue;
00053 };
00054
00055
00056 class EcefVector {
00057 public:
00058 EcefVector() { }
00059 EcefVector(const Vector3& v) : mVector(v) {}
00060 EcefVector(double x, double y, double z) : mVector(x,y,z) {}
00061
00062 const Vector3& vector() const { return mVector; }
00063 void vector(const Vector3& v) { mVector = v; }
00064
00065 double x() const { return mVector[0]; }
00066 double y() const { return mVector[1]; }
00067 double z() const { return mVector[2]; }
00068 void x(double x) { mVector[0] = x; }
00069 void y(double y) { mVector[1] = y; }
00070 void z(double z) { mVector[2] = z; }
00071
00072 LlaVector llaVector(const GeographicEllipsoid& ellipse) const;
00073 private:
00074 Vector3 mVector;
00075 };
00076
00077 };
00078
00079
00080 #endif