Jacob Harding

Software Engineer | C++ Specialist | Graphics Enthusiast

I’m currently on the lookout for my next software engineering role — if you know of something cool, feel free to reach out! 😊

Tetrahedron Volume Gradient

The (signed) volume of a tetrahedron can be calculated as: \[ V_{tet} = \frac{1}{6} (\mathbf{x}_1 - \mathbf{x}_0) \cdot ((\mathbf{x}_2 - \mathbf{x}_0) \times (\mathbf{x}_3 - \mathbf{x}_0)) \] This formula is derived from the volume of a parallelepiped. Computing the derivative of this volume is essential in many deformable body simulations which are built ontop of tetrahedral finite elements. I’m going to make use of the dot product and cross product matrix calculus identities as well as cross product matrices in the derivation that follows.

Differentiating the R^3 Multivariate Vector Cross Product

Suppose \(\mathbf{x} \in \mathbb{R}^{3 \times 1}\) and \(\mathbf{f}(\mathbf{x}), \mathbf{g}(\mathbf{x}): \mathbb{R}^{3 \times 1} \rightarrow \mathbb{R}^{3 \times 1}\). The goal is to find the matrix of first-order partial derivatives of the cross product of \(\mathbf{f}\) and \(\mathbf{g}\): \[ \frac{\partial}{\partial \mathbf{x}}(\mathbf{f}(\mathbf{x}) \times \mathbf{g}(\mathbf{x}))\] A matrix of first-order partial derivatives is also called a Jacobian matrix so an equivalent notation can be defined: \[ \mathbf{J}_{\mathbf{x}}(\mathbf{f}(\mathbf{x}) \times \mathbf{g}(\mathbf{x})) = \frac{\partial}{\partial \mathbf{x}}(\mathbf{f}(\mathbf{x}) \times \mathbf{g}(\mathbf{x}))\] Instead of taking the derivative with respect to the whole \(\mathbf{x}\), its easier to take it with respect to each component of \(\mathbf{x}\) individually, and build the Jacobian from each of these derivatives.