I am writing a program that incorporates calculating the principal moment of inertia for a protein residue based on its component atom XYZ coordinates. I am exceedingly confused about which formulas to use in calculating principal moment of inertia for my situation.
Thus far my program does the following:
- Calculate elements (Ixx, Iyy, Izz, etc.) of symmetric matrix A
- Find the eigenvalues (and thus the principal moments of inertia)
The formulas I originally used to calculate the elements in step 1 were from pg. 5 of this document. However looking at Wikipedia, the formulas for the symmetric matrix elements are different.
I have also been scouring the internet and found open source code where the center of mass is subtracted from the x, y, and z coordinates before beginning calculation of elements Ixx, Iyy, Izz, etc.
Which formulas/algorithm do I use to calculate principal moment of inertia for my case? I'm not sure where to begin with picking which formulas to use. Is there a source that is accessible to those with a weak physics background that will help me understand which formula/algorithm to use in calculating principal moment of inertia?
