00001 #pragma ident "$Id: Triple.hpp 3140 2012-06-18 15:03:02Z susancummins $"
00002
00008 #ifndef GPSTK_TRIPLE_HPP
00009 #define GPSTK_TRIPLE_HPP
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #include <valarray>
00048 #include <vector>
00049 #include "Exception.hpp"
00050 #include "Vector.hpp"
00051
00052 namespace gpstk
00053 {
00056
00059 NEW_EXCEPTION_CLASS(GeometryException, gpstk::Exception);
00060
00066 class Triple
00067 {
00068 public:
00070 Triple();
00071
00073 Triple(const Triple& right);
00074
00076 Triple(double a,
00077 double b,
00078 double c);
00079
00081 virtual ~Triple() {}
00082
00084 Triple& operator=(const Triple& right);
00085
00089 Triple& operator=(const std::valarray<double>& right)
00090 throw(GeometryException);
00091
00092
00094 Vector<double> toVector();
00095
00096
00098 std::vector<double> toStdVector();
00099
00105 double dot(const Triple& right) const
00106 throw();
00107
00113 Triple cross(const Triple& right) const
00114 throw();
00115
00119 double mag() const
00120 throw();
00121
00125 Triple unitVector() const
00126 throw(GeometryException);
00127
00133 double cosVector(const Triple& right) const
00134 throw(GeometryException);
00135
00141 double slantRange(const Triple& right) const
00142 throw();
00143
00150 double elvAngle(const Triple& right) const
00151 throw(GeometryException);
00152
00158 double azAngle(const Triple& right) const
00159 throw(GeometryException);
00160
00165 Triple R1(const double& angle) const
00166 throw();
00167
00168
00173 Triple R2(const double& angle) const
00174 throw();
00175
00176
00181 Triple R3(const double& angle) const
00182 throw();
00183
00189 double& operator[](const size_t index)
00190 { return theArray[index]; }
00191
00197 double operator[](const size_t index) const
00198 { return theArray[index]; }
00199
00200
00206 bool operator== (const Triple& right) const ;
00207
00208
00214 Triple operator-(const Triple& right) const ;
00215
00221 Triple operator+(const Triple& right) const ;
00222
00229 friend Triple operator*(double right, const Triple& rhs);
00230
00232 size_t size(void) const
00233 { return theArray.size(); }
00234
00240 friend std::ostream& operator<<(std::ostream& s,
00241 const gpstk::Triple& v);
00242
00243 std::valarray<double> theArray;
00244
00245 };
00246
00248
00249 }
00250
00251
00252 #endif