User:Karsten Theis/Rigid body interpolation
From Proteopedia
This page shows a way to superpose two rigid bodies so that they both have the same rotation, and they are translated such that a common anchor (center of mass, given atom) is in the same location.
The entire coordinates are copies first so that you can play around with the parameters and then reset the coordinates. The starting point is a structure with two models containing the same atoms in the same order, but with different coordinates.
coordinates = {all}.xyz {all}.xyz = coordinates define selection1 1.1 and (912-984) and *:A define selection2 1.2 and (912-984) and *:A anchor1 = {1.1 and 984:A.CA}.xyz anchor2 = {1.2 and 984:A.CA}.xyz fourbyfour = compare({selection1}, {selection2}) total_quat = quaternion(@fourbyfour%1) progress = 0.5 ssergorp = 1 - progress quat1 = total_quat * progress quat2 = total_quat * ssergorp * -1 select selection1 rotateselected @quat1 molecular rotatedanchor1 = quat1 * anchor1 transl1 = -rotatedanchor1 translateselected @transl1 select selection2 rotateselected @quat2 molecular rotatedanchor1 = quat2 * anchor2 transl2 = -rotatedanchor2 translateselected @transl2
|