AngleReduced.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 
39 #ifndef GNSSTK_ANGLEREDUCED_HPP
40 #define GNSSTK_ANGLEREDUCED_HPP
41 
42 #include <limits>
43 #include <iostream>
44 #include <iomanip>
45 #include <sstream>
46 #include "AngleType.hpp"
47 
48 namespace gnsstk
49 {
51 
52 
61  {
62  public:
64  AngleReduced();
65 
72  AngleReduced(double v, AngleType t)
73  { setValue(v, t); }
74 
79  AngleReduced(double s, double c)
80  : sine(s), cosine(c)
81  {}
82 
84  inline bool operator==(const AngleReduced& right) const
85  { return ((sine == right.sine) && (cosine == right.cosine)); }
86 
91  void setValue(double v, AngleType t);
92 
94  inline double sin() const
95  { return sine; }
96 
98  inline double cos() const
99  { return cosine; }
100 
102  inline std::string asString() const;
103 
104  protected:
105  double sine;
106  double cosine;
107  }; // class AngleReduced
108 
109 
110  inline std::ostream& operator<<(std::ostream& s, const AngleReduced& a)
111  {
112  s << std::setprecision(20) << "sin:" << a.sin() << ",cos:" << a.cos();
113  return s;
114  }
115 
116 
117  std::string AngleReduced ::
118  asString() const
119  {
120  std::ostringstream s;
121  s << *this;
122  return s.str();
123  }
124 
125 } // namespace gnsstk
126 
127 namespace std
128 {
129  inline double sin(gnsstk::AngleReduced x)
130  { return x.sin(); }
131  inline double cos(gnsstk::AngleReduced x)
132  { return x.cos(); }
133 }
134 
135 #endif // GNSSTK_ANGLEREDUCED_HPP
gnsstk::AngleReduced
Definition: AngleReduced.hpp:60
gnsstk::AngleReduced::operator==
bool operator==(const AngleReduced &right) const
Standard equality operator.
Definition: AngleReduced.hpp:84
gnsstk::AngleReduced::sin
double sin() const
Get the sine of this angle.
Definition: AngleReduced.hpp:94
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
std::sin
double sin(gnsstk::Angle x)
Definition: Angle.hpp:144
gnsstk::AngleReduced::setValue
void setValue(double v, AngleType t)
Definition: AngleReduced.cpp:53
gnsstk::AngleReduced::AngleReduced
AngleReduced(double s, double c)
Definition: AngleReduced.hpp:79
gnsstk::AngleReduced::cos
double cos() const
Get the cosine of this angle.
Definition: AngleReduced.hpp:98
gnsstk::AngleReduced::AngleReduced
AngleReduced()
Initialize all data to NaN.
Definition: AngleReduced.cpp:46
gnsstk::operator<<
std::ostream & operator<<(std::ostream &s, const ObsEpoch &oe) noexcept
Definition: ObsEpochMap.cpp:54
gnsstk::AngleReduced::AngleReduced
AngleReduced(double v, AngleType t)
Definition: AngleReduced.hpp:72
gnsstk::AngleType
AngleType
Definition: AngleType.hpp:54
std::cos
double cos(gnsstk::Angle x)
Definition: Angle.hpp:146
gnsstk::AngleReduced::sine
double sine
The sine of the angle.
Definition: AngleReduced.hpp:105
gnsstk::AngleReduced::cosine
double cosine
The cosine of the angle.
Definition: AngleReduced.hpp:106
std
Definition: Angle.hpp:142
gnsstk::AngleReduced::asString
std::string asString() const
Return a string containing the data separated by commas (sin,cos).
Definition: AngleReduced.hpp:118
AngleType.hpp


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