GeographicLib 2.1.2
|
An accurate representation of angles. More...
#include <AuxLatitude.hpp>
Public Types | |
typedef T | real |
Public Member Functions | |
AuxAngle (real y=0, real x=1) | |
real | y () const |
real | x () const |
real & | y () |
real & | x () |
real | degrees () const |
real | radians () const |
real | tan () const |
AuxAngle | normalized () const |
void | normalize () |
AuxAngle | copyquadrant (const AuxAngle &p) const |
AuxAngle & | operator+= (const AuxAngle &p) |
template<typename T1 > | |
real | AbsError (const AuxAngle< T1 > &p) const |
template<typename T1 > | |
real | RelError (const AuxAngle< T1 > &p) const |
Static Public Member Functions | |
static AuxAngle | degrees (real d) |
static AuxAngle | radians (real r) |
static AuxAngle | NaN () |
An accurate representation of angles.
This class is an implementation of the methods described in
An angle is represented be the y and x coordinates of a point in the 2d plane. The two coordinates are proportional to the sine and cosine of the angle. This allows angles close to the cardinal points to be represented accurately. Only angles in [−180°, 180°] can be represented. (A possible extension would be to keep count of the number of turns.)
T | the floating-point type to use for real numbers. |
Definition at line 55 of file AuxLatitude.hpp.
typedef T GeographicLib::AuxAngle< T >::real |
The floating-point type for real numbers. This just connects to the template parameters for the class.
Definition at line 61 of file AuxLatitude.hpp.
|
inline |
The constructor.
[in] | y | the y coordinate. |
[in] | x | the x coordinate. |
The defaults (x = 1 and y = 0) are such that
Definition at line 75 of file AuxLatitude.hpp.
|
inline |
Definition at line 80 of file AuxLatitude.hpp.
Referenced by GeographicLib::AuxLatitude< T >::Convert(), GeographicLib::AuxAngle< T >::copyquadrant(), and GeographicLib::AuxLatitude< T >::FromAuxiliary().
|
inline |
Definition at line 85 of file AuxLatitude.hpp.
Referenced by GeographicLib::AuxLatitude< T >::Convert(), GeographicLib::AuxAngle< T >::copyquadrant(), and GeographicLib::AuxLatitude< T >::FromAuxiliary().
|
inline |
Definition at line 90 of file AuxLatitude.hpp.
|
inline |
Definition at line 95 of file AuxLatitude.hpp.
real GeographicLib::AuxAngle< T >::degrees | ( | ) | const |
real GeographicLib::AuxAngle< T >::radians | ( | ) | const |
|
inline |
Definition at line 109 of file AuxLatitude.hpp.
Referenced by GeographicLib::AuxLatitude< T >::FromAuxiliary(), and GeographicLib::AuxAngle< T >::operator+=().
AuxAngle< T > GeographicLib::AuxAngle< T >::normalized |
Definition at line 58 of file AuxLatitude.cpp.
Referenced by GeographicLib::AuxLatitude< T >::Convert(), and GeographicLib::AuxAngle< T >::normalize().
|
inline |
Normalize the AuxAngle in place so that the y and x components are equal to the sine and cosine of the angle.
Definition at line 120 of file AuxLatitude.hpp.
References GeographicLib::AuxAngle< T >::normalized().
AuxAngle< T > GeographicLib::AuxAngle< T >::copyquadrant | ( | const AuxAngle< T > & | p | ) | const |
Set the quadrant for the AuxAngle.
[in] | p | the AuxAngle from which the quadrant information is taken. |
Definition at line 74 of file AuxLatitude.cpp.
References GeographicLib::AuxAngle< T >::x(), and GeographicLib::AuxAngle< T >::y().
Referenced by GeographicLib::AuxLatitude< T >::FromAuxiliary().
AuxAngle< T > & GeographicLib::AuxAngle< T >::operator+= | ( | const AuxAngle< T > & | p | ) |
Add an AuxAngle.
[in] | p | the AuxAngle to be added. |
The addition is done in place, altering the current AuxAngle.
Definition at line 79 of file AuxLatitude.cpp.
References GeographicLib::AuxAngle< T >::tan().
|
static |
Convert degrees to an AuxAngle.
[in] | d | the angle measured in degrees. |
This allows a new AuxAngle to be initialized as an angle in degrees with
This is the so-called "named constructor" idiom.
|
static |
Convert radians to an AuxAngle.
[in] | r | the angle measured in radians. |
This allows a new AuxAngle to be initialized as an angle in radians with
This is the so-called "named constructor" idiom.
|
static |
Definition at line 52 of file AuxLatitude.cpp.
real GeographicLib::AuxAngle< T >::AbsError | ( | const AuxAngle< T1 > & | p | ) | const |
Compute the absolute error in another angle.
T1 | the floating-point type of the other angle. |
[in] | p | the other angle |
real GeographicLib::AuxAngle< T >::RelError | ( | const AuxAngle< T1 > & | p | ) | const |
Compute the relative error in another angle.
T1 | the floating-point type of the other angle. |
[in] | p | the other angle |