Loading...
Searching...
No Matches
Foam::vectorTools Namespace Reference

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.

Detailed Description

Collection of functions for testing relationships between two vectors.

Function Documentation

◆ areParallel()

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.

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ areOrthogonal()

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.

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().

Here is the call graph for this function:

◆ areAcute()

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.

Definition at line 88 of file vectorTools.H.

References b.

◆ areObtuse()

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.

Definition at line 101 of file vectorTools.H.

References b.

◆ cosPhi()

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.

Definition at line 114 of file vectorTools.H.

References b, Foam::clamp(), cosPhi(), Foam::mag(), and Foam::T().

Referenced by cosPhi(), and radAngleBetween().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ radAngleBetween()

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.

Definition at line 131 of file vectorTools.H.

References Foam::acos(), b, Foam::clamp(), cosPhi(), Foam::mag(), and Foam::T().

Referenced by degAngleBetween().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ degAngleBetween()

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.

Definition at line 148 of file vectorTools.H.

References b, radAngleBetween(), Foam::radToDeg(), and Foam::T().

Here is the call graph for this function: