Wrap data for just the sine and cosine of an angle. Intended to be used in geometry where the actual angle isn't used as a term itself, but only sine and/or cosine are. This saves a bit of computing time by storing the sin and cos of an angle when such values are used repeatedly in geometric equations, rather than recomputing the value multiple times over the course of a method/function.
Definition at line 60 of file AngleReduced.hpp.
#include <AngleReduced.hpp>
Public Member Functions | |
AngleReduced () | |
Initialize all data to NaN. More... | |
AngleReduced (double s, double c) | |
AngleReduced (double v, AngleType t) | |
std::string | asString () const |
Return a string containing the data separated by commas (sin,cos). More... | |
double | cos () const |
Get the cosine of this angle. More... | |
bool | operator== (const AngleReduced &right) const |
Standard equality operator. More... | |
void | setValue (double v, AngleType t) |
double | sin () const |
Get the sine of this angle. More... | |
Protected Attributes | |
double | cosine |
The cosine of the angle. More... | |
double | sine |
The sine of the angle. More... | |
gnsstk::AngleReduced::AngleReduced | ( | ) |
Initialize all data to NaN.
Definition at line 46 of file AngleReduced.cpp.
|
inline |
Initialize using an angular value. The sine and cosine will be derived from each other using the Pythagorean identity sin**2+cos**2=1.
[in] | v | The value to set. |
[in] | t | The type of datum contained in v. |
Definition at line 72 of file AngleReduced.hpp.
|
inline |
Initialize using the sine and cosine values.
[in] | s | The sine value of the angle being represented. |
[in] | c | The cosine value of the angle being represented. |
Definition at line 79 of file AngleReduced.hpp.
|
inline |
Return a string containing the data separated by commas (sin,cos).
Definition at line 118 of file AngleReduced.hpp.
|
inline |
Get the cosine of this angle.
Definition at line 98 of file AngleReduced.hpp.
|
inline |
Standard equality operator.
Definition at line 84 of file AngleReduced.hpp.
void gnsstk::AngleReduced::setValue | ( | double | v, |
AngleType | t | ||
) |
Set all values from a single angle datum.
[in] | v | The value to set. |
[in] | t | The type of datum contained in v. |
Definition at line 53 of file AngleReduced.cpp.
|
inline |
Get the sine of this angle.
Definition at line 94 of file AngleReduced.hpp.
|
protected |
The cosine of the angle.
Definition at line 106 of file AngleReduced.hpp.
|
protected |
The sine of the angle.
Definition at line 105 of file AngleReduced.hpp.