# Inertia tensor of triangle

The inertia tensor ${\displaystyle \mathbf {J} }$ of a triangle (like the inertia tensor of any body) can be expressed in terms of covariance ${\displaystyle \mathbf {C} }$ of the body:

${\displaystyle \mathbf {J} =\mathrm {tr} (\mathbf {C} )\mathbf {I} -\mathbf {C} }$

where covariance is defined as area integral over the triangle:

${\displaystyle \mathbf {C} \triangleq \int _{\Delta }\rho \mathbf {x} \mathbf {x} ^{\mathrm {T} }\,dA}$

Covariance for a triangle in three-dimensional space, assuming that mass is equally distributed over the surface with unit density, is

${\displaystyle \mathbf {C} =a\mathbf {V} ^{\mathrm {T} }\mathbf {S} \mathbf {V} }$

where

• ${\displaystyle \mathbf {V} }$ represents 3 × 3 matrix containing triangle vertex coordinates ${\displaystyle (\mathbf {v} _{0},\mathbf {v} _{1},\mathbf {v} _{2})}$ in the rows,
• ${\displaystyle a=|(\mathbf {v} _{1}-\mathbf {v} _{0})\times (\mathbf {v} _{2}-\mathbf {v} _{0})|}$ is twice the area of the triangle,
• ${\displaystyle \mathbf {S} ={\frac {1}{24}}{\begin{bmatrix}2&1&1\\1&2&1\\1&1&2\\\end{bmatrix}}}$

Substitution of triangle covariance in definition of inertia tensor gives eventually

${\displaystyle \mathbf {J} ={\frac {a}{24}}(\mathbf {v} _{0}^{2}+\mathbf {v} _{1}^{2}+\mathbf {v} _{2}^{2}+(\mathbf {v} _{0}+\mathbf {v} _{1}+\mathbf {v} _{2})^{2})\mathbf {I} -a\mathbf {V} ^{\mathrm {T} }\mathbf {S} \mathbf {V} }$

## A proof of the formula

The proof given here follows the steps from the article.[1]

### Covariance of a canonical triangle

Let's compute covariance of the right triangle with the vertices (0,0,0), (1,0,0), (0,1,0).

Following the definition of covariance we receive

${\displaystyle \mathbf {C} _{xx}^{0}=\int _{\Delta }x^{2}\,dA=\int _{x=0}^{1}x^{2}\int _{y=0}^{1-x}\,dy\,dx=\int _{0}^{1}x^{2}(1-x)\,dx={\frac {1}{12}}}$
${\displaystyle \mathbf {C} _{xy}^{0}=\int _{\Delta }xy\,dA=\int _{x=0}^{1}x\int _{y=0}^{1-x}y\,dy\,dx=\int _{0}^{1}x{\frac {(1-x)^{2}}{2}}\,dx={\frac {1}{24}}}$
${\displaystyle \mathbf {C} _{yy}^{0}=\mathbf {C} _{xx}^{0}}$

The rest components of ${\displaystyle C}$ are zero because the triangle is in ${\displaystyle z=0}$.

As a result,

${\displaystyle \mathbf {C} ^{0}={\frac {1}{24}}{\begin{bmatrix}2&1&0\\1&2&0\\0&0&0\\\end{bmatrix}}={\frac {1}{48}}{\begin{bmatrix}1\\-1\\0\end{bmatrix}}{\begin{bmatrix}1&-1&0\end{bmatrix}}^{\mathrm {T} }+{\frac {1}{16}}{\begin{bmatrix}1\\1\\0\end{bmatrix}}{\begin{bmatrix}1&1&0\end{bmatrix}}^{\mathrm {T} }}$

### Covariance of the triangle with a vertex in the origin

Consider a linear operator

${\displaystyle \mathbf {x} '=\mathbf {A} \mathbf {x} ^{0}}$

that maps the canonical triangle in the triangle ${\displaystyle \mathbf {v} '_{0}=\mathbf {0} }$, ${\displaystyle \mathbf {v} '_{1}=\mathbf {v} _{1}-\mathbf {v} _{0}}$, ${\displaystyle \mathbf {v} '_{2}=\mathbf {v} _{2}-\mathbf {v} _{0}}$. The first two columns of ${\displaystyle \mathbf {A} }$ contain ${\displaystyle \mathbf {v} '_{1}}$ and ${\displaystyle \mathbf {v} '_{2}}$ respectively, while the third column is arbitrary. The target triangle is equal to the triangle in question (in particular their areas are equal), but shifted with its zero vertex in the origin.

${\displaystyle \mathbf {C} '=\int _{\Delta '}\mathbf {x} '\mathbf {x} '^{\mathrm {T} }\,dA'=\int _{\Delta ^{0}}\mathbf {A} \mathbf {x} ^{0}\mathbf {x} ^{0\mathrm {T} }\mathbf {A} ^{\mathrm {T} }a\,dA^{0}=a\mathbf {A} \mathbf {C} ^{0}\mathbf {A} ^{\mathrm {T} }}$
${\displaystyle \mathbf {C} '={\frac {a}{48}}(\mathbf {v} _{1}-\mathbf {v} _{2})(\mathbf {v} _{1}-\mathbf {v} _{2})^{\mathrm {T} }+{\frac {a}{16}}(\mathbf {v} _{1}+\mathbf {v} _{2}-2\mathbf {v} _{0})(\mathbf {v} _{1}+\mathbf {v} _{2}-2\mathbf {v} _{0})^{\mathrm {T} }}$

### Covariance of the triangle in question

The last thing remaining to be done is to conceive how covariance is changed with the translation of all points on vector ${\displaystyle \mathbf {v} _{0}}$.

${\displaystyle \mathbf {C} =\int _{\Delta }(\mathbf {x'} +\mathbf {v} _{0})(\mathbf {x'} +\mathbf {v} _{0})^{\mathrm {T} }\,dA=\mathbf {C} '+{\frac {a}{2}}(\mathbf {v} _{0}\mathbf {v} _{0}^{\mathrm {T} }+\mathbf {v} _{0}{\overline {\mathbf {x} }}'^{\mathrm {T} }+{\overline {\mathbf {x} }}'\mathbf {v} _{0}^{\mathrm {T} })}$

where

${\displaystyle {\overline {\mathbf {x} }}'=\int _{\Delta '}\mathbf {x} '\,dA'={\frac {1}{3}}(\mathbf {v} '_{1}+\mathbf {v} '_{2})={\frac {1}{3}}(\mathbf {v} _{1}+\mathbf {v} _{2}-2\mathbf {v} _{0})}$

is the centroid of dashed triangle.

It's easy to check now that all coefficients in ${\displaystyle \mathbf {C} }$ before ${\displaystyle \mathbf {v} _{i}\mathbf {v} _{i}^{\mathrm {T} }}$ is ${\displaystyle {\frac {a}{12}}}$ and before ${\displaystyle \mathbf {v} _{i}\mathbf {v} _{j}^{\mathrm {T} }\;(i\neq j)}$ is ${\displaystyle {\frac {a}{24}}}$. This can be expressed in matrix form with ${\displaystyle \mathbf {S} }$ as above.

## References

1. ^ http://number-none.com/blow/inertia/bb_inertia.doc Jonathan Blow, Atman J Binstock (2004) "How to find the inertia tensor (or other mass properties) of a 3D solid body represented by a triangle mesh"