radtools.volume#

radtools.volume(*args) float[source]#

Computes volume.

Added in version 0.7.

Three type of arguments are expected:

  • One argument.

    Matrix cell. Volume is computed as:

    \[V = v_1 \cdot (v_2 \times v_3)\]
  • Three arguments.

    Vectors v1, v2, v3. Volume is computed as:

    \[V = v_1 \cdot (v_2 \times v_3)\]
  • Six arguments.

    Parameters a, b, c, alpha, beta, gamma. Volume is computed as:

    \[V = abc\sqrt{1+2\cos(\alpha)\cos(\beta)\cos(\gamma)-\cos^2(\alpha)-\cos^2(\beta)-\cos^2(\gamma)}\]
Parameters:
v1(3,) array-like

First vector.

v2(3,) array-like

Second vector.

v3(3,) array-like

Third vector.

cell(3,3) array-like

Cell matrix, rows are interpreted as vectors.

afloat, default 1

Length of the \(v_1\) vector.

bfloat, default 1

Length of the \(v_2\) vector.

cfloat, default 1

Length of the \(v_3\) vector.

alphafloat, default 90

Angle between vectors \(v_2\) and \(v_3\). In degrees.

betafloat, default 90

Angle between vectors \(v_1\) and \(v_3\). In degrees.

gammafloat, default 90

Angle between vectors \(v_1\) and \(v_2\). In degrees.

Returns:
volumefloat

Volume of corresponding region in space.

Notes

Volume can be negative if the three vectors are not right-handed.