00001 #pragma ident "$Id: Triple.hpp 1181 2008-04-04 13:53:36Z btolman $"
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 "Exception.hpp"
00049
00050 namespace gpstk
00051 {
00054
00057 NEW_EXCEPTION_CLASS(GeometryException, gpstk::Exception);
00058
00064 class Triple
00065 {
00066 public:
00068 Triple();
00069
00071 Triple(const Triple& right);
00072
00074 Triple(double a,
00075 double b,
00076 double c);
00077
00079 virtual ~Triple() {}
00080
00082 Triple& operator=(const Triple& right);
00083
00087 Triple& operator=(const std::valarray<double>& right)
00088 throw(GeometryException);
00089
00095 double dot(const Triple& right) const
00096 throw();
00097
00103 Triple cross(const Triple& right) const
00104 throw();
00105
00109 double mag() const
00110 throw();
00111
00115 Triple unitVector() const
00116 throw(GeometryException);
00117
00123 double cosVector(const Triple& right) const
00124 throw(GeometryException);
00125
00131 double slantRange(const Triple& right) const
00132 throw();
00133
00140 double elvAngle(const Triple& right) const
00141 throw(GeometryException);
00142
00148 double azAngle(const Triple& right) const
00149 throw(GeometryException);
00150
00155 Triple R1(const double& angle) const
00156 throw();
00157
00158
00163 Triple R2(const double& angle) const
00164 throw();
00165
00166
00171 Triple R3(const double& angle) const
00172 throw();
00173
00179 double& operator[](const size_t index)
00180 { return theArray[index]; }
00181
00187 double operator[](const size_t index) const
00188 { return theArray[index]; }
00189
00190
00196 bool operator== (const Triple& right) const ;
00197
00198
00204 Triple operator-(const Triple& right) const ;
00205
00211 Triple operator+(const Triple& right) const ;
00212
00219 friend Triple operator*(double right, const Triple& rhs);
00220
00222 size_t size(void) const
00223 { return theArray.size(); }
00224
00230 friend std::ostream& operator<<(std::ostream& s,
00231 const gpstk::Triple& v);
00232
00233 std::valarray<double> theArray;
00234
00235 };
00236
00238
00239 }
00240
00241
00242 #endif