text: # Inertia tensor formula for point masses in rigid assembly?
  
  Suppose I have $$N$$ 1kg point masses in a massless rigid assembly such that the center of mass of the assembly is at the origin and point mass i is at $$(x_i, y_i, z_i)$$.
  
  The inertia tensor of the assembly is given by:
  
  $$I = \sum_{i \in 1..N} F(x_i, y_i, z_i)$$
  
  The function $$F$$ takes 3 scalars and returns a 3x3 matrix. What is the formula for $$F$$?
  
  I think its something like: https://hepweb.ucsd.edu/ph110b/110b_notes/node21.html
  
  But I'm not sure what $$r$$ is in terms of $$x_i$$, $$y_i$$, $$z_i$$?
  
  • The r is just the position vector, $\vec{r}=x\hat{i}+y\hat{j}+z\hat{k}$, of each particle. Commented Feb 12, 2021 at 10:37
  • @Triatticus: Ahh, of course - so $r^2$ is $x^2 + y^2 + z^2$. Commented Feb 12, 2021 at 10:44
  • Yes that's exactly what that would mean, and I see you answered your question correctly too, though you might want to expand and make an actual detailed step by step of what you did there. This makes the answer useful to more than just yourself. Commented Feb 12, 2021 at 19:56
  
  Given a point mass $$m$$, located at a point defined by the vector $$\vec{r} = \pmatrix{x \\ y \\ z}$$ the mass moment of inertia tensor can me defined with one of two different functions (both yielding the same result)
  
  • The vector algebra way $$\mathrm{I} = m \left( \vec{r} \cdot \vec{r} - \vec{r} \odot \vec{r} \right)$$
  
  where $$\cdot$$ is the vector inner product, and $$\odot$$ the vector outer product.
  
  Specifically $$\mathrm{I} = m \left( (x^2+y^2+z^2) \mathrm{1} - \begin{vmatrix} x^2 & x y & x z \\ x y & y^2 & y z \\ x z & y z & z^2 \end{vmatrix} \right) = m \begin{vmatrix} y^2+z^2 & -x y & -x z \\ -x y & x^2+z^2 & -y z \\ -x z & -y z & x^2 + y^2 \end{vmatrix}$$
  
  • The linear algebra way $$\mathrm{I} = m \left( - [\vec{r}\times][\vec{r}\times] \right)$$
  
  where $$[\vec{r}\times]$$ is the skew-symmetric cross product operator matrix defined by $$[\vec{r}\times] = \begin{vmatrix} 0 & -z & y \\ z & 0 & -x \\ -y & x & 0 \end{vmatrix}$$
  
  Specifically $$\mathrm{I} = m \left( - \begin{vmatrix} 0 & -z & y \\ z & 0 & -x \\ -y & x & 0 \end{vmatrix} \begin{vmatrix} 0 & -z & y \\ z & 0 & -x \\ -y & x & 0 \end{vmatrix} \right) = m \begin{vmatrix} y^2+z^2 & -x y & -x z \\ -x y & x^2+z^2 & -y z \\ -x z & -y z & x^2 + y^2 \end{vmatrix}$$
  
  Both of them are derived from calculating the angular momentum vector of an orbiting point mass and factoring out the rotational velocity vector. The result is $$\vec{L} = m \,\vec{r} \times (\vec{\omega} \times \vec{r})$$ and if you use the identity $$a \times (b \times c) = b (a\cdot c) - c (a \cdot b)$$ you end up with the fist expression, and if you use matrix cross product operator $$\vec{a}\times \vec{b} = [\vec{a}\times] \vec{b}$$ you end up with the second expression.
  
  In terms of programming, I prefer the second one as computers do better with linear algebra, compared with vector algebra
  
  r = vector(x,y,z) = [x,y,z]
  cross(r) = [ [0,-r(3),r(2)], [r(3),0,-r(1)], [-r(2),r(1),0] ]
  I = m*(-cross(r)*cross(c))
  
  
  provided that the * operator can handle matrix multiplication
  
  $$F(x,y,z) = \begin{vmatrix} y^2+z^2&-xy&-xz\\ -xy&x^2 + z^2&-yz\\ -xz&-yz&x^2+y^2\\ \end{vmatrix}$$
  
  • Where is the mass part? Commented Feb 4, 2022 at 13:55
  • @JohnAlexiou: The point masses are 1kg each. See question. Commented Feb 5, 2022 at 4:38