wulfric.volume#

wulfric.volume(*args)[source]#

Computes volume.

Three type of arguments are expected:

  • One argument.

    Matrix cell. Volume is computed as:

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

    Vectors \boldsymbol{v_1}, \boldsymbol{v_2}, \boldsymbol{v_3}. Volume is computed as:

    \[V = \boldsymbol{v_1} \cdot (\boldsymbol{v_2} \times \boldsymbol{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.