Skip to content

Calculate and apply the optimal transformation matrix that minimizes the RMSD (root mean squared deviation) between two paired sets of points.

License

Notifications You must be signed in to change notification settings

ardcore/fit_transform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fit_transform

Problem

Given two corresponding sets of 2D points A and B, find and apply an optimal transformation matrix to bring set A as close as possible to set B.

Solution

  • fit_transform implements full Kabsch algorithm for datasets where N >= 3
  • closeness of sets is understood as RMSD
  • this implementation focuses on 2D points only, but can be easily generalised to support more dimensions

API

  • fitTransform(A, B) -> A' -- returns a transformed dataset
  • kabsch(A, B) -> C -- returns an optimal rotation matrix

Installation

npm install fit_transform

Building and Testing

yarn
yarn build
yarn test
cd examples/
python -m SimpleHTTPServer

Examples

Image showing fit_transform applied to a 2-point dataset

Image showing fit_transform applied to a 3-point dataset

Image showing fit_transform applied to a 3-point dataset

See also examples

About

Calculate and apply the optimal transformation matrix that minimizes the RMSD (root mean squared deviation) between two paired sets of points.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published