Lines

This post solves for the general inertia tensor of any line in $\text{3D}$ space. After a point mass, a line is the next simplest object (or so you thought). This post is long because everything is so general. However, all this hard work will be rewarded in the next few posts.


Parameterizing the Curve

Consider any line in $3\text{D}$ space. Suppose its endpoints are positioned at $\b{r}_1 = (x_1, y_1, z_1)$ and $\b{r}_2 = (x_2, y_2, z_2)$. Let $L = \abs{\b{r}_2 - \b{r}_1}$ denote its length.

   


We can parameterize the line as follows.

\[\b{r}(t) = (\b{r}_2 - \b{r}_1) t + \tfrac{1}{2}(\b{r}_1 + \b{r}_2) \\[10pt] \ell = \{ \b{r}(t) \ : \ -\tfrac{1}{2} \leq t \leq \tfrac{1}{2} \}\]

Written in component form

\[\b{r}(t) = ((x_2 - x_1) t + \tfrac{1}{2}(x_2 + x_1)) \; \u{x} + ((y_2 - y_1) t + \tfrac{1}{2}(y_2 + y_1)) \; \u{y} + ((z_2 - z_1) t + \tfrac{1}{2}(z_2 + z_1)) \; \u{z}\]

This may seem like an over-complicated way of parameterizing a line. However, at the end we will see why I’ve written it this way. Now, we find the differential element using the method explained in the background.

\[d \b{\ell} = \frac{\partial \b{r}}{\partial t} dt = \left ( \b{r}_2 - \b{r}_1 \right ) \; dt = \left ( (x_2 - x_1) \; \u{x} + (y_2 - y_1) \; \u{y} + (z_2 - z_1) \; \u{z} \right ) \; dt\] \[d\ell = \abs{d \b{\ell} } = \abs{\b{r}_2 - \b{r}_1} \; dt = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2 + (z_2 - z_1)^2} \; dt = L \; dt\]

Mass

\[\begin{align} M &= \int dm \\[10pt] &= \lambda \int d\ell \\[10pt] &= \lambda \int_{-1/2}^{1/2} L \; dt \\[10pt] &= \lambda L \end{align}\]


Center of Mass

\[\begin{align} \overline{x} &= \tfrac{1}{M} \int x \; dm \\[10pt] &= \tfrac{\lambda}{M} \int x \; d\ell \\[10pt] &= \tfrac{1}{L} \int_{-1/2}^{1/2} x(t) \; L \; dt \\[10pt] &= \int_{-1/2}^{1/2} \left [ (x_2 - x_1) t + \tfrac{1}{2}(x_2 + x_1) \right ] \; dt \\[10pt] &= \left . \left [ \tfrac{1}{2}(x_2 - x_1) t^2 + \tfrac{1}{2}(x_2 + x_1)t \right ] \right \vert_{-1/2}^{1/2} \\[10pt] &= \frac{x_2 + x_1}{2} \\[10pt] \end{align}\]

$\overline{y}$ and $\overline{z}$ can be computed symmetrically. Therefore the total center of mass is the following.

\[\overline{\b{r}} = \tfrac{1}{2} (\b{r}_2 + \b{r}_1) = \tfrac{1}{2} (x_2 + x_1) \; \u{x} + \tfrac{1}{2} (y_2 + y_1) \; \u{y} + \tfrac{1}{2} (z_2 + z_1) \; \u{z}\]

This makes intuitive sense. The center of mass is the middle of the line, which is the average of the endpoints.


Moment of Inertia

Without loss of generality, we can assume the axis of rotation is the $z$-axis. The other axes can be computed symmetrically.

\[\begin{align} I_{zz} &= \int r_{axis}^2 dm \\[10pt] &= \lambda \int r_{axis}^2 d\ell \\[10pt] &= \lambda \int_{-1/2}^{1/2} \left [ (x(t))^2 + (y(t))^2 \right ] \; L \; dt \\[10pt] &= \lambda \int_{-1/2}^{1/2} \left [ ((x_2 - x_1) t + \tfrac{1}{2}(x_2 + x_1))^2 + ((y_2 - y_1) t + \tfrac{1}{2}(y_2 + y_1))^2 \right ] \; L \; dt \\[10pt] &= \lambda \cdot \left . \left [ \frac{((x_2 - x_1) t + \tfrac{1}{2}(x_2 + x_1))^3}{3(x_2 - x_1)} + \frac{((y_2 - y_1) t + \tfrac{1}{2}(y_2 + y_1))^3}{3(y_2 - y_1)} \right ] \right \vert_{-1/2}^{1/2} \; L \\[10pt] &= \lambda \cdot \left [ \frac{x_2^3 - x_1^2}{3(x_2 - x_1)} + \frac{y_2^3 - y_1^2}{3(y_2 - y_1)} \right ] \; L \\[10pt] &= \tfrac{1}{3} M \left [ \frac{x_2^3 - x_1^2}{x_2 - x_1} + \frac{y_2^3 - y_1^2}{y_2 - y_1} \right ] \\[10pt] &= \tfrac{1}{3} M \left [ (x_1^2 + x_1x_2 + x_2^2) + (y_1^2 + y_1y_2 + y_2^2) \right ] \\[10pt] &= \tfrac{1}{3} M \left [ (x_1 + x_2)^2 + (y_1 + y_2)^2 - x_1x_2 - y_1y_2 \right ] \\[10pt] &= \tfrac{1}{3} M \left [ (x_2 - x_1)^2 + (y_2 - y_1)^2 + 3x_1x_2 + 3y_1y_2 \right ] \\[10pt] &= \tfrac{1}{6} M \left [ 3x_1^2 + 3x_2^3 + 3y_1^2 + 3y_2^2 - (x_2 - x_1)^2 - (y_2 - y_1)^2 \right ] \\[10pt] \end{align}\]

At the end, I put a number different forms. One may be more useful than the others in different applications.


Product of Inertia

Let’s compute $I_{xy}$. The other product of inertia values $I_{yz}$ and $I_{zx}$ can be computed symmetrically.

\[\begin{align} I_{xy} &= \int xy \; dm \\[10pt] &= \lambda \int xy \; d\ell \\[10pt] &= \lambda \int_{-1/2}^{1/2} \left [ ((x_2 - x_1) t + \tfrac{1}{2}(x_2 + x_1)) \cdot ((y_2 - y_1) t + \tfrac{1}{2}(y_2 + y_1)) \right ] \; L \; dt \\[10pt] &= \lambda \int_{-1/2}^{1/2} \left [ (x_2 - x_1)(y_2 - y_1) t^2 + \tfrac{1}{2}(x_2 + x_1) (y_2 - y_1) t + \tfrac{1}{2}(x_2 - x_1)(y_2 + y_1) t + \tfrac{1}{4} (x_2 + x_1) (y_2 + y_1) \right ] \; L \; dt \\[10pt] &= \lambda \cdot \left [ \tfrac{1}{3}(x_2 - x_1)(y_2 - y_1) t^3 + \tfrac{1}{4}(x_2 + x_1) (y_2 - y_1) t^2 + \tfrac{1}{4}(x_2 - x_1)(y_2 + y_1) t^2 + \tfrac{1}{4} (x_2 + x_1) (y_2 + y_1)t \right ] \Big \vert_{-1/2}^{1/2} \; L \\[10pt] &= \lambda \cdot \left [ \tfrac{1}{12}(x_2 - x_1)(y_2 - y_1) + \tfrac{1}{4} (x_2 + x_1) (y_2 + y_1) \right ] \; L \\[10pt] &= M \left [ \tfrac{1}{12}(x_2 - x_1)(y_2 - y_1) + \tfrac{1}{4} (x_2 + x_1) (y_2 + y_1) \right ] \\[10pt] &= \tfrac{1}{6} M \left [ 2(x_2 - x_1) (y_2 - y_1) + 3x_1y_1 + 3x_2y_2 \right ] \\[10pt] &= \tfrac{1}{6} M \left [ (x_2 + x_1) (y_2 + y_1) + x_1y_1 + x_2y_2 \right ] \end{align}\]

Now, we could technically write the inertia tensor, but it would be long, gross, and not really helpful. Luckily, there is more we can do to simplify these expressions.


Reformulating the Moment of Inertia and Product of Inertia Equations

The above formulas are general, but they are not super helpful as they depend on the coordinate system rather than the geometry of the line and axis of rotation. The only reason we did it this way was because it made the integration very easy. However, now we can reformulate the general formula into something more useful.

\[\begin{align} I_{zz} &= \tfrac{1}{3} M \left [ (x_2 - x_1)^2 + (y_2 - y_1)^2 + 3x_1x_2 + 3y_1y_2 \right ] \\[10pt] &= \tfrac{1}{12} M \left [ 4(x_2 - x_1)^2 + 4(y_2 - y_1)^2 + 12x_1x_2 + 12y_1y_2 \right ] \\[10pt] &= \tfrac{1}{12} M \left [ (x_2 - x_1)^2 + (y_2 - y_1)^2 + 3(x_2^2 - 2x_1x_2 + x_1^2) + 3(y_2^2 - 2y_1y_2 + y_1^2) + 3(4x_1x_2 + 4y_1y_2) \right ] \\[10pt] &= \tfrac{1}{12} M \left [ (x_2 - x_1)^2 + (y_2 - y_1)^2 + 3(x_2^2 + 2x_1x_2 + x_1^2) + 3(y_2^2 + 2y_1y_2 + y_1^2) \right ] \\[10pt] &= \tfrac{1}{12} M \left [ (x_2 - x_1)^2 + (y_2 - y_1)^2 + 3(x_2 + x_1)^2 + 3(y_2 + y_1)^2 \right ] \\[10pt] &= \tfrac{1}{12} M \left [ (x_2 - x_1)^2 + (y_2 - y_1)^2 \right ] + \tfrac{1}{4} M \left [ \left ( x_2 + x_1 \right )^2 + \left ( y_2 + y_1 \right )^2 \right ] \\[10pt] &= \tfrac{1}{12} M \left [ (x_2 - x_1)^2 + (y_2 - y_1)^2 \right ] + M \left [ \left ( \frac{x_2 + x_1}{2} \right )^2 + \left ( \frac{y_2 + y_1}{2} \right )^2 \right ] \end{align}\]

Likewise, we can do something similar to the product of inertia equation.

\[\begin{align} I_{xy} &= M \left [ \tfrac{1}{12}(x_2 - x_1)(y_2 - y_1) + \tfrac{1}{4} (x_2 + x_1) (y_2 + y_1) \right ] \\[10pt] &= \tfrac{1}{12} M (x_2 - x_1) (y_2 - y_1) + M \left ( \frac{x_2 + x_1}{2} \right ) \left ( \frac{y_2 + y_1}{2} \right ) \end{align}\]


Between these equations, there are obvious common elements. In fact, these elements have very nice geometric interpretations.

    

Consider the following definitions.

\[\b{L} \equiv \b{r}_2 - \b{r}_1 = (x_2 - x_1) \; \u{x} + (y_2 - y_1) \; \u{y} + (z_2 - z_1) \; \u{z} \\[10pt] \overline{\b{r}} \equiv \tfrac{1}{2} (\b{r}_2 + \b{r}_1) = \tfrac{1}{2} (x_2 + x_1) \; \u{x} + \tfrac{1}{2} (y_2 + y_1) \; \u{y} + \tfrac{1}{2} (z_2 + z_1) \; \u{z}\]

The first definition lets us write the line as a vector in terms of its endpoints, which gives us the direction of the line. The second definition gives us the center of mass of the line, which gives us the position of the line. Now we have a much more elegant way to parameterize the curve.

\[\b{r}(t) = \b{L}t + \overline{\b{r}} = (L_x t + \overline{x}) \; \u{x} + (L_y t + \overline{y}) \; \u{y} + (L_z t + \overline{z}) \; \u{z}\]

where we define

\[L_x = (x_2 - x_1) \qquad\qquad L_y = (y_2 - y_1) \qquad\qquad L_z = (z_2 - z_1) \\[15pt] \overline{x} = \frac{x_2 + x_1}{2} \qquad\qquad \overline{y} = \frac{y_2 + y_1}{2} \qquad\qquad \overline{z} = \frac{z_2 + z_1}{2}\]

Finally, we can write our moment of inertia equations as the following

\[I_{zz} = \tfrac{1}{12}M(L_x^2 + L_y^2) + M((\overline{x})^2 + (\overline{y})^2) \\[10pt] I_{xy} = \tfrac{1}{12}M L_x L_y + M (\overline{x}) (\overline{y})\]




Inertia Tensor

Finally, we can write the general inertia tensor of any line in $\text{3D}$ space.

\[\m{I} = \tfrac{1}{12} M \begin{bmatrix} L_y^2 + L_z^2 & - L_x L_y & - L_x L_z \\ - L_y L_x & L_z^2 + L_x^2 & - L_y L_z \\ - L_z L_x & - L_z L_y & L_x^2 + L_y^2 \end{bmatrix} + M \begin{bmatrix} (\overline{y})^2 + (\overline{z})^2 & - (\overline{x}) (\overline{y}) & - (\overline{x}) (\overline{z}) \\ - (\overline{y}) (\overline{x}) & (\overline{z})^2 + (\overline{x})^2 & - (\overline{y}) (\overline{z}) \\ - (\overline{z}) (\overline{x}) & - (\overline{z}) (\overline{y}) & (\overline{x})^2 + (\overline{y})^2 \end{bmatrix}\]

Let $\otimes$ denote the outer product \(\boldsymbol{u} \otimes \boldsymbol{v} = \begin{bmatrix} u_1 v_1 & u_1 v_2 & \cdots & u_1 v_n \\ u_2 v_1 & u_2 v_2 & \cdots & u_2 v_n \\ \vdots & \vdots & \ddots & \vdots \\ u_m v_1 & u_m v_2 & \cdots & u_m v_n \end{bmatrix}\) and $\m{ \mathbb{I} }$ be the identity matrix \(\left [ \ \mathbb{I} \ \right ] = \begin{bmatrix} 1 & 0 & \cdots & 0 \\ 0 & 1 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & 1 \end{bmatrix}\) .

\[I = \tfrac{1}{12} M (L^2\m{\mathbb{I}} - \b{L} \otimes \b{L}) + M (D^2 \m{\mathbb{I}} - \overline{\b{r}} \otimes \overline{\b{r}})\]


Recall the alterative formulation of the parallel axis theorem. We can do a similar thing for the inertia tensor of a line.

\[\m{I} = \tfrac{1}{12} M L^2 \begin{bmatrix} \sin^2 \alpha_x & - \cos \alpha_x \cos \alpha_y & - \cos \alpha_x \cos \alpha_z \\ - \cos \alpha_y \cos \alpha_x & \sin^2 \alpha_y & - \cos \alpha_y \cos \alpha_z \\ - \cos \alpha_z \cos \alpha_x & - \cos \alpha_z \cos \alpha_y & \sin^2 \alpha_z \end{bmatrix} + M D^2 \begin{bmatrix} \sin^2 \beta_x & - \cos \beta_x \cos \beta_y & - \cos \beta_x \cos \beta_z \\ - \cos \beta_y \cos \beta_x & \sin^2 \beta_y & - \cos \beta_y \cos \beta_z \\ - \cos \beta_z \cos \beta_x & - \cos \beta_z \cos \beta_y & \sin^2 \beta_z \end{bmatrix}\]

$\alpha_x$, $\alpha_y$, and $\alpha_z$ are the angles of the line with respect to the $x$, $y$, and $z$-axes respectively. $\beta_x$, $\beta_y$, and $\beta_z$ are the angles of the vector to the center of mass of the line with respect to the $x$, $y$, and $z$-axes respectively.

We can write this compactly as the following.

\[\m{I} = \tfrac{1}{12} ML^2 (\m{\mathbb{I}} - \cos(\b{\alpha}) \otimes \cos(\b{\alpha})) + MD^2 (\m{\mathbb{I}} - \cos(\b{\beta}) \otimes \cos(\b{\beta}))\]




Special Cases

There are two common special cases for a line. We will look at more special cases where the line is restricted to the $xy$ plane in the next post.

Moment of Inertia About Center of Mass

Suppose the center of mass of the line is at the origin.

    

Therefore, $D = 0$ and we simplify from the general inertia tensor.

\[\m{I} = \tfrac{1}{12} M \begin{bmatrix} L_y^2 + L_z^2 & - L_x L_y & - L_x L_z \\ - L_y L_x & L_z^2 + L_x^2 & - L_y L_z \\ - L_z L_x & - L_z L_y & L_x^2 + L_y^2 \end{bmatrix} = \tfrac{1}{12} M L^2 \begin{bmatrix} \sin^2 \alpha_x & - \cos \alpha_x \cos \alpha_y & - \cos \alpha_x \cos \alpha_z \\ - \cos \alpha_y \cos \alpha_x & \sin^2 \alpha_y & - \cos \alpha_y \cos \alpha_z \\ - \cos \alpha_z \cos \alpha_x & - \cos \alpha_z \cos \alpha_y & \sin^2 \alpha_z \end{bmatrix}\]

If we only care about the moment of inertia, we can fix an axis of rotation $\b{\omega}$ with the line rotating about its center at an angle $\alpha$.

This gives the formula you may have seen before.

\[I = \tfrac{1}{12} M L^2 \sin^2 \alpha\]

For practical purposes, this is the most important formula to know. The moment of inertia of a line about any axis can be derived from this formula combined with the parallel axis theorem.


Moment of Inertia About Endpoint

Suppose one of the endpoints of the line is at the origin.

    

Here, $(\alpha_x, \alpha_y, \alpha_z) = (\beta_x, \beta_y, \beta_z)$ since the line and the center of mass vector point in the same direction. Also, $D = L/2$. Again, we simplify from the general inertia tensor.

\[\m{I} = \tfrac{1}{3} M \begin{bmatrix} L_y^2 + L_z^2 & - L_x L_y & - L_x L_z \\ - L_y L_x & L_z^2 + L_x^2 & - L_y L_z \\ - L_z L_x & - L_z L_y & L_x^2 + L_y^2 \end{bmatrix} = \tfrac{1}{3} M L^2 \begin{bmatrix} \sin^2 \alpha_x & - \cos \alpha_x \cos \alpha_y & - \cos \alpha_x \cos \alpha_z \\ - \cos \alpha_y \cos \alpha_x & \sin^2 \alpha_y & - \cos \alpha_y \cos \alpha_z \\ - \cos \alpha_z \cos \alpha_x & - \cos \alpha_z \cos \alpha_y & \sin^2 \alpha_z \end{bmatrix}\]

Again, if we fix an axis of rotation $\b{\omega}$ with the line rotating about its end at an angle $\alpha$.

This gives the formula you may have seen before.

\[I = \tfrac{1}{3} M L^2 \sin^2 \alpha\]

Moments of Inertia Series