Triple.hpp

Go to the documentation of this file.
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 //  This file is part of GPSTk, the GPS Toolkit.
00014 //
00015 //  The GPSTk is free software; you can redistribute it and/or modify
00016 //  it under the terms of the GNU Lesser General Public License as published
00017 //  by the Free Software Foundation; either version 2.1 of the License, or
00018 //  any later version.
00019 //
00020 //  The GPSTk is distributed in the hope that it will be useful,
00021 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 //  GNU Lesser General Public License for more details.
00024 //
00025 //  You should have received a copy of the GNU Lesser General Public
00026 //  License along with GPSTk; if not, write to the Free Software Foundation,
00027 //  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
00028 //  
00029 //  Copyright 2004, The University of Texas at Austin
00030 //
00031 //============================================================================
00032 
00033 //============================================================================
00034 //
00035 //This software developed by Applied Research Laboratories at the University of
00036 //Texas at Austin, under contract to an agency or agencies within the U.S. 
00037 //Department of Defense. The U.S. Government retains all rights to use,
00038 //duplicate, distribute, disclose, or release this software. 
00039 //
00040 //Pursuant to DoD Directive 523024 
00041 //
00042 // DISTRIBUTION STATEMENT A: This software has been approved for public 
00043 //                           release, distribution is unlimited.
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    }; // class Triple
00246 
00248 
00249 } // namespace gpstk
00250 
00251 
00252 #endif

Generated on Fri May 24 03:31:13 2013 for GPS ToolKit Software Library by  doxygen 1.3.9.1