# SimPEG.utils.volume_tetrahedron#

SimPEG.utils.volume_tetrahedron(xyz, A, B, C, D)[source]#

Returns the tetrahedron volumes for a specified set of verticies.

Let xyz be an (n, 3) array denoting a set of vertex locations. Any 4 vertex locations a, b, c and d can be used to define a tetrahedron. For the set of tetrahedra whose verticies are indexed in vectors A, B, C and D, this function returns the corresponding volumes. See algorithm: https://en.wikipedia.org/wiki/Tetrahedron#Volume

$vol = {1 \over 6} \big | ( \mathbf{a - d} ) \cdot ( ( \mathbf{b - d} ) \times ( \mathbf{c - d} ) ) \big |$
Parameters
xyz(n_pts, 3) numpy.ndarray

x,y, and z locations for all verticies

A(n_tetra) numpy.ndarray of int

Vector containing the indicies for the a vertex locations

B(n_tetra) numpy.ndarray of int

Vector containing the indicies for the b vertex locations

C(n_tetra) numpy.ndarray of int

Vector containing the indicies for the c vertex locations

D(n_tetra) numpy.ndarray of int

Vector containing the indicies for the d vertex locations

Returns
(n_tetra) numpy.ndarray

Volumes of the tetrahedra whose vertices are indexed by A, B, C and D.

Examples