Collection of functions for testing relationships between two vectors. More...
Functions | |
template<class T > | |
bool | areParallel (const Vector< T > &a, const Vector< T > &b, const T &tolerance=small) |
Test if a and b are parallel: a^b = 0. More... | |
template<class T > | |
bool | areOrthogonal (const Vector< T > &a, const Vector< T > &b, const T &tolerance=small) |
Test if a and b are orthogonal: a.b = 0. More... | |
template<class T > | |
bool | areAcute (const Vector< T > &a, const Vector< T > &b) |
Test if angle between a and b is acute: a.b > 0. More... | |
template<class T > | |
bool | areObtuse (const Vector< T > &a, const Vector< T > &b) |
Test if angle between a and b is obtuse: a.b < 0. More... | |
template<class T > | |
T | cosPhi (const Vector< T > &a, const Vector< T > &b, const T &tolerance=small) |
Calculate angle between a and b in radians. More... | |
template<class T > | |
T | radAngleBetween (const Vector< T > &a, const Vector< T > &b, const T &tolerance=small) |
Calculate angle between a and b in radians. More... | |
template<class T > | |
T | degAngleBetween (const Vector< T > &a, const Vector< T > &b, const T &tolerance=small) |
Calculate angle between a and b in degrees. More... | |
Collection of functions for testing relationships between two vectors.
bool Foam::vectorTools::areParallel | ( | const Vector< T > & | a, |
const Vector< T > & | b, | ||
const T & | tolerance = small |
||
) |
Test if a and b are parallel: a^b = 0.
Uses the cross product, so the tolerance is proportional to the sine of the angle between a and b in radians
Definition at line 54 of file vectorTools.H.
References areOrthogonal(), and Foam::mag().
Referenced by indexedCell< Gt, Cb >::potentialCoplanarCell().
bool Foam::vectorTools::areOrthogonal | ( | const Vector< T > & | a, |
const Vector< T > & | b, | ||
const T & | tolerance = small |
||
) |
Test if a and b are orthogonal: a.b = 0.
Uses the dot product, so the tolerance is proportional to the cosine of the angle between a and b in radians
Definition at line 71 of file vectorTools.H.
References areAcute(), and Foam::mag().
Referenced by areParallel().
Test if angle between a and b is acute: a.b > 0.
Definition at line 83 of file vectorTools.H.
References areObtuse().
Referenced by areOrthogonal().
Test if angle between a and b is obtuse: a.b < 0.
Definition at line 94 of file vectorTools.H.
References cosPhi(), and Foam::T().
Referenced by areAcute().
T Foam::vectorTools::cosPhi | ( | const Vector< T > & | a, |
const Vector< T > & | b, | ||
const T & | tolerance = small |
||
) |
Calculate angle between a and b in radians.
Definition at line 105 of file vectorTools.H.
References Foam::constant::physicoChemical::b, Foam::mag(), Foam::max(), Foam::min(), radAngleBetween(), and Foam::T().
Referenced by areObtuse(), Foam::diff(), radAngleBetween(), and radiativeIntensityRay::radiativeIntensityRay().
T Foam::vectorTools::radAngleBetween | ( | const Vector< T > & | a, |
const Vector< T > & | b, | ||
const T & | tolerance = small |
||
) |
Calculate angle between a and b in radians.
Definition at line 120 of file vectorTools.H.
References Foam::acos(), Foam::constant::physicoChemical::b, cosPhi(), degAngleBetween(), Foam::mag(), Foam::max(), Foam::min(), and Foam::T().
Referenced by cosPhi(), and degAngleBetween().
T Foam::vectorTools::degAngleBetween | ( | const Vector< T > & | a, |
const Vector< T > & | b, | ||
const T & | tolerance = small |
||
) |
Calculate angle between a and b in degrees.
Definition at line 135 of file vectorTools.H.
References radAngleBetween(), and Foam::radToDeg().
Referenced by radAngleBetween().