Skip to content

Commit

Permalink
[#293] the KabschTransform matrix was not being built correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
YHordijk committed Aug 20, 2024
1 parent c0d76f2 commit 5bf507f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/tcutility/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,14 @@ def __init__(self, X: np.ndarray, Y: np.ndarray):
R = V.T @ d @ U.T

# build the transformation:
# for a sequence of transformation operations we have to invert their order
# We have that Y ~= (R @ (X - centroid_x).T).T + centroid_y
# the normal order is to first translate X by -centroid_x
# then rotate with R
# finally translate by +centroid_y
self.M = self._build_matrix()
self.translate(centroid_y)
self.rotate(R)
self.translate(-centroid_x)
self.rotate(R)
self.translate(centroid_y)


class MolTransform(Transform):
Expand Down

0 comments on commit 5bf507f

Please sign in to comment.