Collection of functions for testing relationships between two vectors. More...
Functions | |
template<typename 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<typename 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<typename 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<typename 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<typename 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<typename 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<typename 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 Foam::constant::physicoChemical::b, and Foam::mag().
Referenced by indexedCell::potentialCoplanarCell(), and test().
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 Foam::constant::physicoChemical::b, and Foam::mag().
Referenced by test().
Test if angle between a and b is acute: a.b > 0.
Definition at line 83 of file vectorTools.H.
References Foam::constant::physicoChemical::b.
Referenced by test().
Test if angle between a and b is obtuse: a.b < 0.
Definition at line 94 of file vectorTools.H.
References Foam::constant::physicoChemical::b.
Referenced by test().
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(), and Foam::min().
Referenced by 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(), Foam::mag(), Foam::max(), and Foam::min().
Referenced by 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 Foam::constant::physicoChemical::b, radAngleBetween(), and Foam::radToDeg().
Referenced by test().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.