Triple.hpp

Go to the documentation of this file.
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 //  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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  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 "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    }; // class Triple
00236 
00238 
00239 } // namespace gpstk
00240 
00241 
00242 #endif

Generated on Thu Sep 2 03:30:58 2010 for GPS ToolKit Software Library by  doxygen 1.3.9.1