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

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

References b, and Foam::mag().

Here is the call graph for this function:

## ◆ areAcute()

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

References b.

## ◆ areObtuse()

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

References b.

## ◆ cosPhi()

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

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

Referenced by cosPhi(), and radAngleBetween().

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

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

References Foam::acos(), b, cosPhi(), Foam::mag(), Foam::max(), and Foam::min().

Referenced by degAngleBetween().

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

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