I'm studying some molecular systems, and one of my problems is that I have three planes of atoms that vibrate and oscillate about each other (imagine something like this: http://www.webelements.com/_media/elements/allotropes/C/C-graphite.jpg). One way to find the distance between each pair of planes is to compute the center of mass of each plane and then take the length of the vector between those two points.
But I want to decompose the motion of the 3 planes into vertical (planes moving in and out towards each other) and horizontal (planes sliding in and out of each other) components.
So I wrote a script to find the mathematical plane of best fit for each group of atoms and this gave me the normal vector for each plane. Then I projected the center of mass vector onto the normal vector, and called that my "vertical distance component".
Which was all fine and dandy until I realized that if I project the normal vector from the other plane (in a pair of two planes) onto the center of mass vector that I get a completely different "vertical distance component". I guess I assumed these two projections were the same distance, but when I did the math I found out they are not.
So now I'm really confused which of these vertical distances I should use as the vertical component of motion. (I can draw a diagram if it helps).