Public Member Functions | Protected Attributes | List of all members
gnsstk::AngleReduced Class Reference

Detailed Description

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>

Inheritance diagram for gnsstk::AngleReduced:
Inheritance graph
[legend]

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...
 

Constructor & Destructor Documentation

◆ AngleReduced() [1/3]

gnsstk::AngleReduced::AngleReduced ( )

Initialize all data to NaN.

Definition at line 46 of file AngleReduced.cpp.

◆ AngleReduced() [2/3]

gnsstk::AngleReduced::AngleReduced ( double  v,
AngleType  t 
)
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.

Parameters
[in]vThe value to set.
[in]tThe type of datum contained in v.
Postcondition
sin and cos are set.

Definition at line 72 of file AngleReduced.hpp.

◆ AngleReduced() [3/3]

gnsstk::AngleReduced::AngleReduced ( double  s,
double  c 
)
inline

Initialize using the sine and cosine values.

Parameters
[in]sThe sine value of the angle being represented.
[in]cThe cosine value of the angle being represented.
Postcondition
sin and cos are set.

Definition at line 79 of file AngleReduced.hpp.

Member Function Documentation

◆ asString()

std::string gnsstk::AngleReduced::asString ( ) const
inline

Return a string containing the data separated by commas (sin,cos).

Definition at line 118 of file AngleReduced.hpp.

◆ cos()

double gnsstk::AngleReduced::cos ( ) const
inline

Get the cosine of this angle.

Definition at line 98 of file AngleReduced.hpp.

◆ operator==()

bool gnsstk::AngleReduced::operator== ( const AngleReduced right) const
inline

Standard equality operator.

Definition at line 84 of file AngleReduced.hpp.

◆ setValue()

void gnsstk::AngleReduced::setValue ( double  v,
AngleType  t 
)

Set all values from a single angle datum.

Parameters
[in]vThe value to set.
[in]tThe type of datum contained in v.
Postcondition
sin and cos are set.

Definition at line 53 of file AngleReduced.cpp.

◆ sin()

double gnsstk::AngleReduced::sin ( ) const
inline

Get the sine of this angle.

Definition at line 94 of file AngleReduced.hpp.

Member Data Documentation

◆ cosine

double gnsstk::AngleReduced::cosine
protected

The cosine of the angle.

Definition at line 106 of file AngleReduced.hpp.

◆ sine

double gnsstk::AngleReduced::sine
protected

The sine of the angle.

Definition at line 105 of file AngleReduced.hpp.


The documentation for this class was generated from the following files:


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