mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
geo.hpp File Reference

Utilities for working with angles. More...

Utilities for working with angles.

Author
Jared R. Males

Definition in file geo.hpp.

Go to the source code of this file.

Classes

struct  mx::math::degradT< degrees, _realT >
 Type holding constants related to angle calculations in degrees. More...
 
struct  mx::math::degradT< radians, _realT >
 Type holding constants related to angle calculations in radians. More...
 

Namespaces

 mx
 The mxlib c++ namespace.
 

Functions

template<typename realT >
realT mx::math::dtor (realT q)
 Convert from degrees to radians. More...
 
template<typename realT >
realT mx::math::rtod (realT q)
 Convert from radians to degrees. More...
 
template<class angleT >
angleT::realT mx::math::angleMod (typename angleT::realT q)
 Calculate the angle modulo full-circle, normalizing to a positive value. More...
 
template<class angleT >
angleT::realT mx::math::angleDiff (typename angleT::realT q1, typename angleT::realT q2)
 Calculate the difference between two angles, correctly across 0/360. More...
 
template<class angleT >
angleT::realT mx::math::angleMean (const std::vector< typename angleT::realT > &q)
 Calculate the mean of a set of angles, correctly across 0/360. More...
 
template<int degrad = 0, typename realT >
int mx::math::continueAngles (std::vector< realT > &angles, realT threshold=0.75)
 Make a vector of angles continuous, fixing the 0/360 crossing. More...
 
template<typename realT >
void mx::math::rotatePoint (realT &x0, realT &y0, realT angle)
 Rotate a point about the origin. More...