The open source CFD toolbox
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. 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...

Detailed Description

Collection of functions for testing relationships between two vectors.

◆ areParallel()

 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 56 of file vectorTools.H.

References Foam::constant::physicoChemical::b, and Foam::mag().

Referenced by indexedCell< Gt, Cb >::potentialCoplanarCell().

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

◆ areOrthogonal()

 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 73 of file vectorTools.H.

References Foam::constant::physicoChemical::b, and Foam::mag().

Here is the call graph for this function:

◆ areAcute()

 bool Foam::vectorTools::areAcute ( const Vector< T > & a, const Vector< T > & b )

Test if angle between a and b is acute: a.b > 0.

Definition at line 85 of file vectorTools.H.

References Foam::constant::physicoChemical::b.

◆ areObtuse()

 bool Foam::vectorTools::areObtuse ( const Vector< T > & a, const Vector< T > & b )

Test if angle between a and b is obtuse: a.b < 0.

Definition at line 96 of file vectorTools.H.

References Foam::constant::physicoChemical::b.

◆ cosPhi()

 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 107 of file vectorTools.H.

References Foam::constant::physicoChemical::b, Foam::mag(), Foam::max(), and Foam::min().

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

 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 122 of file vectorTools.H.

Referenced by degAngleBetween().

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

◆ 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 137 of file vectorTools.H.