Two-dimensional Moments
$
\def \hieruit {\quad \Longrightarrow \quad}
\def \slechts {\quad \Longleftrightarrow \quad}
\def \half {\frac{1}{2}}
\def \EN {\quad \mbox{and} \quad}
$
Consider an arbitrary 2-D distribution of points $(x_k,y_k)$ in the plane.
Aagain, a quantity called weight or mass $w_k$ is associated with each of
these points. And again, we can define a spot, called the midpoint, center
of mass or whatever name is to be preferred:
$$
\sum_k w_k = 1
$$ $$
\mu_x = \overline{x} = \sum_k w_k x_k \EN
\mu_y = \overline{y} = \sum_k w_k y_k
$$
This is the discrete form. The continuous alternative is:
$$
\iint w(x,y) \,dx\,dy = 1
$$ $$
\mu_x = \overline{x} = \iint w(x,y) x \,dx\,dy \EN
\mu_y = \overline{y} = \iint w(x,y) y \,dx\,dy
$$
Second order momenta, also called moments of inertia, are defined with respect
to an origin $(p,q)$:
$$
\sigma_{xx}(p) = \sum_k w_k (x_k - p)^2 \EN
\sigma_{yy}(q) = \sum_k w_k (y_k - q)^2
$$ $$
\sigma_{xy}(p,q) = \sum_k w_k (x_k - p) (y_k - q)
$$
The continuous form is:
$$
\sigma_{xx}(p) = \iint w(x,y) (x-p)^2 \,dx\,dy \EN
\sigma_{yy}(q) = \iint w(x,y) (y-q)^2 \,dx\,dy
$$ $$
\sigma_{xy}(p,q) = \iint w(x,y) (x-p) (y-q) \,dx\,dy
$$
It has already been shown that, at least for $\sigma_{xx}$ ,there exists a
preferrable origin, which is precisely the center of mass / geometric mean
of the points distribution:
$$
\sum_{k} w_k (x_k - p)^2 = \mbox{minimum}(p) \slechts
p = \overline{x} = \sum_k w_k x_k
$$
In very much the same way (method: what's in a name) we can prove for
$\sigma_{yy}$ :
$$
\sum_{k} w_k (y_k - q)^2 = \mbox{minimum}(q) \slechts
q = \overline{y} = \sum_k w_k y_k
$$
How about the "mixed" second order moment $\sigma_{xy}$ ?
$$
\sigma_{xy}(\overline{x},\overline{y}) =
\sum_k w_k (x_k - \overline{x}) (y_k - \overline{y}) = \sum_k w_k x_k y_k
- \sum_k w_k x_k \overline{y} - \sum_k w_k y_k \overline{x}
+ \overline{x} \, \overline{y} =
$$ $$
\sum_k x_k y_k - \overline{x} \, \overline{y} - \overline{y} \, \overline{x}
+ \overline{x} \, \overline{y} \hieruit \sigma_{xy} =
\overline{x y} - \overline{x} \, \overline{y}
$$
Again, unless explicitly stated otherwise, it will be assumed in the sequel
that all moments of inertia are with respect to the midpoint $(\mu_x,\mu_y)$.
Then we can drop $(p,q)$ in:
$$
\sigma_{xx} = \sum_k w_k (x_k - \mu_x)^2 \EN
\sigma_{yy} = \sum_k w_k (y_k - \mu_y)^2
$$ $$
\sigma_{xy} = \sum_k w_k (x_k - \mu_x) (y_k - \mu_y)
$$
So far, it is less clear what kind of physical meaning should be attached to
the quantity $\sigma_{xy}$ , which is known as a "cross correlation" in
probability theory and statistics. Well, to be precise:
$$
\rho = \frac{\sigma_{xy}}{\sqrt{\sigma_{xx} \sigma_{yy}}}
$$
Where $\rho$ is the so-called cross-correlation coefficient.
Suppose however, that we don't like $\sigma_{xy}$ at all and we only want
to get rid of this term. How then could such a thing be accomplished ? It can
certainly not be done by translation, since the origin of our coordinate system
has already become fixed at the midpoint. But there is another possibility.
It could be done by rotating the coordinate system in such a way that
$\sigma'_{xy}$ becomes zero in the new ('primed') system. Let's give it a try.
Start with:
$$
\left\{
\begin{array}{c}
x' = \cos(\theta) x + \sin(\theta) y \\
y' = - \sin(\theta) x + \cos(\theta) y
\end{array} \right.
$$
Then:
$$
\sigma'_{xy} = 0 \slechts \sum_k w_k x'_k y'_k =
$$ $$
\sum_k w_k \left[ \cos(\theta) x_k + \sin(\theta) y_k \right]
\left[-\sin(\theta) x_k + \cos(\theta) y_k \right] =
$$ $$
- \cos(\theta) \sin(\theta) \sum_k w_k x^2_k
+ \sin(\theta) \cos(\theta) \sum_k w_k y^2_k
$$ $$
+ \left[ \cos^2(\theta) - \sin^2(\theta) \right] \sum_k w_k x_k y_k
$$
Two goniometric formulas should me memorized here:
$$
\sin(2 \theta) = 2 \sin(\theta) \cos(\theta) \EN
\cos(2 \theta) = \cos^2(\theta) - \sin^2(\theta)
$$
Herewith:
$$
\sum_k w_k x'_k y'_k =
- \half \sin(2\theta) (\sigma_{xx} - \sigma_{yy})
+ \cos(2\theta) \sigma_{xy} = 0
$$
Resulting in:
$$
\tan(2 \theta) = \frac{2 \sigma_{xy}}{\sigma_{xx} - \sigma_{yy}}
\qquad \mbox{for} \quad \sigma_{xx} \ne \sigma_{yy}
$$
And as special cases:
$$
\sin(2\theta) = 0 \hieruit \theta = k.\frac{\pi}{2} \quad
k = 0,1,2,3 \, ...
$$ $$
\mbox{for} \quad \sigma_{xx} \ne \sigma_{yy} \EN \sigma_{xy} = 0
$$
Meaning that the situation where $\sigma_{xy} = 0$ is found back with every
rotation of the coordinate system over 90 degrees.
$$
\cos(2\theta) = 0 \hieruit \theta = \frac{\pi}{4} + k.\frac{\pi}{2} \quad
k = 0,1,2,3 \, ...
$$ $$
\mbox{for} \quad \sigma_{xx} = \sigma_{yy} \EN \sigma_{xy} \ne 0
$$
Meaning that the situation where $\sigma_{xx} = \sigma_{yy}$ occurs every time
$\theta$ is precisely in the middle between two angles where $\sigma_{xy} = 0$.
If both $\sigma_{xx} = \sigma_{yy}$ and $\sigma_{xy} = 0$ then the choice of
the angle $\theta$ is arbitrary.
The other two moments of inertia, $\sigma'_{xx}$ and $\sigma'_{yy}$, are
expressed into the angle $\theta$ as follows:
$$
\sigma'_{xx} = \sum_k w_k (x'_k)^2
= \sum_k w_k \left[ \cos(\theta) x_k + \sin(\theta) y_k \right]^2
$$ $$
= \cos^2(\theta) \sum_k w_k x_k^2
+ \sin^2(\theta) \sum_k w_k y_k^2
+ 2 \sin(\theta) \cos(\theta) \sum_k w_k x_k y_k
$$ $$
\hieruit \sigma'_{xx}
= \cos^2(\theta) \sigma_{xx}
+ \sin^2(\theta) \sigma_{yy}
+ 2 \sin(\theta) \cos(\theta) \sigma_{xy}
$$
And:
$$
\sigma'_{yy} = \sum_k w_k (y'_k)^2
= \sum_k w_k \left[ - \sin(\theta) x_k + \cos(\theta) y_k \right]^2
$$ $$
= \sin^2(\theta) \sum_k w_k x_k^2
+ \cos^2(\theta) \sum_k w_k y_k^2
- 2 \sin(\theta) \cos(\theta) \sum_k w_k x_k y_k
$$ $$
\hieruit \sigma'_{yy}
= \sin^2(\theta) \sigma_{xx}
+ \cos^2(\theta) \sigma_{yy}
- 2 \sin(\theta) \cos(\theta) \sigma_{xy}
$$
Working out the latter formula somewhat further:
$$
\sigma'_{yy}
= \left[ 1 - \cos^2(\theta) \right] \sigma_{xx}
+ \left[ 1 - \sin^2(\theta) \right] \sigma_{yy}
- 2 \sin(\theta) \cos(\theta) \sigma_{xy}
$$ $$
= \sigma_{xx} + \sigma_{yy} - \sigma'_{xx}
$$
It is thus seen that the sum of the two "main" moments of inertia is entirely
invariant for an orthogonal coordinate transformation:
$$
\sigma'_{xx} + \sigma'_{yy} = \sigma_{xx} + \sigma_{yy}
$$
We conclude that, indeed, the "unwanted" $\sigma_{xy}$ can be eliminated by a
suitable rotation of the coordinate system, while the sum of the other "main"
moments of inertia $( \sigma_{xx} + \sigma_{yy} )$ remains independent of any
such transformation.
The question may be raised for what values of $\theta$ the transformed
moments of inertia $\sigma'_{xx}$ and/or $\sigma'_{yy}$ attain an extreme value,
a maximum or a minimum. In order to find out, derivatives to $\theta$ will be
calculated. First we repeat:
$$
\sigma'_{xx} = \cos^2(\theta) \sigma_{xx} + \sin^2(\theta) \sigma_{yy}
+ 2 \sin(\theta) \cos(\theta) \sigma_{xy}
$$ $$
\sigma'_{yy} = \sin^2(\theta) \sigma_{xx} + \cos^2(\theta) \sigma_{yy}
- 2 \sin(\theta) \cos(\theta) \sigma_{xy}
$$
Giving:
$$
\frac{d}{d\theta} \sigma'_{xx}
= - 2 \sin(\theta) \cos(\theta) \sigma_{xx}
+ 2 \cos(\theta) \sin(\theta) \sigma_{yy}
+ 2 \cos^2(\theta) \sigma_{xy} - 2 \sin^2(\theta) \sigma_{xy}
$$ $$
= - \sin(2\theta) (\sigma_{xx} - \sigma_{yy}) + \cos(2\theta) 2 \sigma_{xy} = 0
$$ $$
\frac{d}{d\theta} \sigma'_{yy}
= + 2 \cos(\theta) \sin(\theta) \sigma_{xx}
- 2 \sin(\theta) \cos(\theta) \sigma_{yy}
- 2 \cos^2(\theta) \sigma_{xy} + 2 \sin^2(\theta) \sigma_{xy}
$$ $$
= + \sin(2\theta) (\sigma_{xx} - \sigma_{yy})
- \cos(2\theta) 2 \sigma_{xy} = 0
$$
It is seen that exactly the same equations are obtained as with
$\sigma'_{xy} = 0$. Meaning that $\sigma'_{xx}$ and $\sigma'_{yy}$ attain their
extreme values, both at the same time, when and only when $\sigma'_{xy} = 0$.
Opposite signs indicate that one of the two extremes, $\sigma'_{xx}$ or
$\sigma'_{yy}$, must be a minimum while the other must be a maximum.
Alternative viewpoints may be obtained by just reversing the whole story. Take
the 'primed' coordinate system for granted. And transform back to 'unprimed'
coordinates. In order to accomplish this, it is not necessary to solve the
above equations for the unprimed moments of inertia. Instead, simply reverse
the angle of rotation and you're done:
$$
\sigma_{xx}
= \cos^2(-\theta) \sigma'_{xx}
+ \sin^2(-\theta) \sigma'_{yy}
+ 2 \sin(-\theta) \cos(-\theta) \sigma'_{xy}
$$ $$
\sigma_{yy}
= \sin^2(-\theta) \sigma'_{xx}
+ \cos^2(-\theta) \sigma'_{yy}
- 2 \sin(-\theta) \cos(-\theta) \sigma'_{xy}
$$ $$
\sigma_{xy} =
- \half \sin(-2\theta) (\sigma'_{xx} - \sigma'_{yy})
+ \cos(-2\theta) \sigma'_{xy}
$$
Remember, however, that the cross correllation moment is zero by definition in
the primed system. At last, consider the primed system as the standard one.
Herewith it is expressed that the coordinate system where the
cross correllation moment is zero is to be considered in the sequel as the
preferred system of coordinates. The x- and y-axis, associated with the
preferred system, are known in Physics as the main axes of inertia. They
are attached to the points cloud, as body fitted coordinates so to speak.
Any other system is now the result of a rotation of the main axes of inertia,
over a certain angle $\theta$ . And the transformed moments of inertia can
always be derived from the main moments of inertia:
$$
\sigma_{xx} = \cos^2(\theta) \sigma'_{xx} + \sin^2(\theta) \sigma'_{yy}
\EN
\sigma_{yy} = \sin^2(\theta) \sigma'_{xx} + \cos^2(\theta) \sigma'_{yy}
$$ $$
\sigma_{xy} = \half \sin(2\theta) (\sigma'_{xx} - \sigma'_{yy})
$$
It is seen that $\sigma_{xy} = 0$ , for $\theta = k.\pi/2 \quad k = 1,2, ...$ .
The same angle values cause $\sigma_{xx}$ to become equal to $\sigma'_{xx}$,
for $\theta = k.\pi$ , or equal to $\sigma'_{yy}$, for $\theta = \pi/2 +
k.\pi$.
And the same angle values cause $\sigma_{yy}$ to become equal to $\sigma'_{yy}$,
for $\theta = k.\pi$ , or equal to $\sigma'_{xx}$, for $\theta = \pi/2 + k.\pi$.
It all means that $\sigma'_{xx}$ and $\sigma'_{yy}$ exchange roles with every
increase of the angle $\theta$ with $90^o$ , while $\sigma_{xy} = 0$ at the
same time.
On the other hand, $\sigma_{xx}$ and $\sigma_{yy}$ become equal for $\theta
= \pi/4 + k.\pi/2$ . Then the cross correllation moment $\sigma_{xy}$ attains
a minimum (negative) or maximum (positive) value of
$\: \pm (\sigma'_{xx}-\sigma'_{yy}) / 4$ .
If $\sigma'_{xx} = \sigma'_{yy}$, that is when the main moments of inertia are
equal to each other, then also the transformed main moments of inertia always
will be equal to each other and the cross correllation moment $\sigma_{xy}$
will always be zero. This special case is often induced by symmetry.
Last but not least. The fact that the above formulas are entirely insensitive to
an increase of the angle $\theta$ with $180^o$ also means that it is impossible
to detect the orientation of the main axes coordinate system, with help
of moments up to the second order alone. However, provided that one has to deal
with the common non-symmetric case, only two possibilities will remain,
and they can differ only by a rotation over 180 degrees.