MCPcopy Create free account
hub / github.com/clemenssielaff/ZodiacGraph / angularDistance

Function angularDistance

zodiacgraph/node.cpp:805–815  ·  view source on GitHub ↗

\brief Calculates the angular distance between two angles, always returning a positive result. \param [in] alpha First angle. \param [in] beta Second angle. \return Angular distance in postive radian [0 -> pi].

Source from the content-addressed store, hash-verified

803/// \return Angular distance in postive radian [0 -> pi].
804///
805static qreal angularDistance(qreal alpha, qreal beta)
806{
807 static const qreal TWO_PI = M_PI*2;
808
809 qreal result = qAbs(alpha-beta);
810 if(result>M_PI){
811 return TWO_PI-result;
812 } else {
813 return result;
814 }
815}

Callers 1

arrangePlugsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected