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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
Collection of functions for testing relationships between two vectors.
| bool 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 b, Foam::mag(), and Foam::T().
Referenced by indexedCell< Gt, Cb >::potentialCoplanarCell().


| bool 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 74 of file vectorTools.H.
References b, Foam::mag(), and Foam::T().

Test if angle between a and b is acute: a.b > 0.
Definition at line 88 of file vectorTools.H.
References b.
Test if angle between a and b is obtuse: a.b < 0.
Definition at line 101 of file vectorTools.H.
References b.
| T cosPhi | ( | const Vector< T > & | a, |
| const Vector< T > & | b, | ||
| const T & | tolerance = SMALL ) |
Calculate angle between a and b in radians.
Definition at line 114 of file vectorTools.H.
References b, Foam::clamp(), cosPhi(), Foam::mag(), and Foam::T().
Referenced by cosPhi(), and radAngleBetween().


| T radAngleBetween | ( | const Vector< T > & | a, |
| const Vector< T > & | b, | ||
| const T & | tolerance = SMALL ) |
Calculate angle between a and b in radians.
Definition at line 131 of file vectorTools.H.
References Foam::acos(), b, Foam::clamp(), cosPhi(), Foam::mag(), and Foam::T().
Referenced by degAngleBetween().


| T degAngleBetween | ( | const Vector< T > & | a, |
| const Vector< T > & | b, | ||
| const T & | tolerance = SMALL ) |
Calculate angle between a and b in degrees.
Definition at line 148 of file vectorTools.H.
References b, radAngleBetween(), Foam::radToDeg(), and Foam::T().
