Triple.hpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
44 #ifndef GNSSTK_TRIPLE_HPP
45 #define GNSSTK_TRIPLE_HPP
46 
47 #include <valarray>
48 #include <vector>
49 #include "Exception.hpp"
50 #include "Vector.hpp"
51 
52 namespace gnsstk
53 {
55 
58  NEW_EXCEPTION_CLASS(GeometryException, gnsstk::Exception);
59 
61 
62 
68  class Triple
69  {
70  public:
72  Triple();
73 
75  Triple(const Triple& right);
76 
78  Triple(double a,
79  double b,
80  double c);
81 
83  virtual ~Triple() {}
84 
86  Triple& operator=(const Triple& right);
87 
91  Triple& operator=(const std::valarray<double>& right);
92 
93 
96 
97 
99  std::vector<double> toStdVector();
100 
106  double dot(const Triple& right) const
107  noexcept;
108 
114  Triple cross(const Triple& right) const
115  noexcept;
116 
120  double mag() const
121  noexcept;
122 
128 
135  double cosVector(const Triple& right) const;
136 
142  double slantRange(const Triple& right) const
143  noexcept;
144 
152  double elvAngle(const Triple& right) const;
153 
160  double azAngle(const Triple& right) const;
161 
166  Triple R1(const double& angle) const
167  noexcept;
168 
169 
174  Triple R2(const double& angle) const
175  noexcept;
176 
177 
182  Triple R3(const double& angle) const
183  noexcept;
184 
190  double& operator[](const size_t index)
191  { return theArray[index]; }
192 
198  double operator[](const size_t index) const
199  { return theArray[index]; }
200 
201 
207  bool operator== (const Triple& right) const ;
208 
209 
215  Triple operator-(const Triple& right) const ;
216 
222  Triple operator+(const Triple& right) const ;
223 
230  friend Triple operator*(double scale, const Triple& rhs);
231 
236  friend Triple operator*(const Triple& rhs, double left)
237  { return operator*(left,rhs); }
238 
240  size_t size(void) const
241  { return theArray.size(); }
242 
248  friend std::ostream& operator<<(std::ostream& s,
249  const gnsstk::Triple& v);
250 
251  std::valarray<double> theArray;
252 
253  }; // class Triple
254 
256 
257 } // namespace gnsstk
258 
259 
260 #endif
gnsstk::Triple::operator<<
friend std::ostream & operator<<(std::ostream &s, const gnsstk::Triple &v)
Definition: Triple.cpp:325
gnsstk::Triple::toVector
Vector< double > toVector()
Return the data as a Vector<double> object.
Definition: Triple.cpp:90
gnsstk::Triple::operator+
Triple operator+(const Triple &right) const
Definition: Triple.cpp:311
gnsstk::Triple::Triple
Triple()
Default constructor, initialize as triple.
Definition: Triple.cpp:52
gnsstk::Triple::size
size_t size(void) const
Return the size of this object.
Definition: Triple.hpp:240
const
#define const
Definition: getopt.c:43
gnsstk::Triple::operator-
Triple operator-(const Triple &right) const
Definition: Triple.cpp:304
gnsstk::Triple::operator==
bool operator==(const Triple &right) const
Definition: Triple.cpp:299
gnsstk::Triple::theArray
std::valarray< double > theArray
Definition: Triple.hpp:251
gnsstk::Triple
Definition: Triple.hpp:68
gnsstk::Triple::R1
Triple R1(const double &angle) const noexcept
Definition: Triple.cpp:249
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::Triple::unitVector
Triple unitVector() const
Definition: Triple.cpp:134
gnsstk::Exception
Definition: Exception.hpp:151
gnsstk::NEW_EXCEPTION_CLASS
NEW_EXCEPTION_CLASS(FileSpecException, gnsstk::Exception)
gnsstk::Triple::dot
double dot(const Triple &right) const noexcept
Definition: Triple.cpp:107
gnsstk::Triple::cosVector
double cosVector(const Triple &right) const
Definition: Triple.cpp:149
gnsstk::Triple::R3
Triple R3(const double &angle) const noexcept
Definition: Triple.cpp:285
gnsstk::Triple::operator*
friend Triple operator*(double scale, const Triple &rhs)
Definition: Triple.cpp:318
gnsstk::Triple::operator[]
double operator[](const size_t index) const
Definition: Triple.hpp:198
gnsstk::Triple::operator=
Triple & operator=(const Triple &right)
Assignment operator.
Definition: Triple.cpp:72
gnsstk::Triple::~Triple
virtual ~Triple()
Destructor.
Definition: Triple.hpp:83
gnsstk::Vector< double >
gnsstk::Triple::operator*
friend Triple operator*(const Triple &rhs, double left)
Definition: Triple.hpp:236
Exception.hpp
gnsstk::Triple::cross
Triple cross(const Triple &right) const noexcept
Definition: Triple.cpp:118
gnsstk::Triple::slantRange
double slantRange(const Triple &right) const noexcept
Definition: Triple.cpp:173
gnsstk::Triple::toStdVector
std::vector< double > toStdVector()
Return the data as a std::vector object.
Definition: Triple.cpp:99
gnsstk::Triple::elvAngle
double elvAngle(const Triple &right) const
Definition: Triple.cpp:185
gnsstk::Triple::azAngle
double azAngle(const Triple &right) const
Definition: Triple.cpp:195
Vector.hpp
gnsstk::Triple::R2
Triple R2(const double &angle) const noexcept
Definition: Triple.cpp:267
gnsstk::Triple::mag
double mag() const noexcept
Definition: Triple.cpp:129


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:42