So, I have a long chained linear molecule, consisting of several identical rings. I want to rotate it so its parallel to one of the coordinate axis $($doesn't matter if its $x$, $y$ or $z$$)$.
My first approach was to choose the first atom in the first ring and the last atom in the last ring, and use this as a molecule vector and calculate its rotational angle with the axes, and then rotate all atoms in the molecule.
This produced final molecule vectors such as $(0.0010,-0.9995,-0.0310)$, which is pretty close to OK $($should be $(0,-1,0)$$)$. However, how can I make it better? Is there a formal way to calculate a more exact molecule vector, by using e. g. the atom coordinates?
Best J