## [PyMOL] Algorithm to Rotate One Set of Vectors onto Another

 [PyMOL] Algorithm to Rotate One Set of Vectors onto Another From: Buz Barstow - 2008-01-25 21:55:32 ```Dear All, I'm looking for an algorithm that will allow me to derive a transformation matrix that superimposes one set of orthogonal vectors onto another set of orthogonal vectors, that I can then use to transform another set of orthogonal vectors. Thanks! and all the best, --Buz ```

 [PyMOL] Algorithm to Rotate One Set of Vectors onto Another From: Buz Barstow - 2008-01-25 21:55:32 ```Dear All, I'm looking for an algorithm that will allow me to derive a transformation matrix that superimposes one set of orthogonal vectors onto another set of orthogonal vectors, that I can then use to transform another set of orthogonal vectors. Thanks! and all the best, --Buz ```
 Re: [PyMOL] Algorithm to Rotate One Set of Vectors onto Another From: Tsjerk Wassenaar - 2008-01-26 09:04:01 ```Hi Buz, To my opinion, this is not the best place for your question. Pymol is a molecular viewer... But the question itself is basically trivial from the linear algebra point of view. If X is your source set of orthogonal vectors and Y is the target, then you should have some sort of matrix R to satisfy Y = RX But, since it should only be a rotation, you'll first have to transform X and Y to their orthonormal counterparts N and M: M = RN Then MN^-1=RNN^-1 such that R = MN^-1 If both sets are of equal dimensions (and full rank), there's an exact solution. Otherwise, there's a bit more trouble... So, taking your favourite language with the proper linear algebra package, it comes down to: normalize X -> N normalize Y -> M invert N multiply M with the inverse of N By the way, you're probably dealing with 3x3 matrices here (molecules in cartesian space), in which case the routines are simple enough to write down yourself (I believe these were even in the array.py I posted like two days ago). Hope it helps, Tsjerk On Jan 25, 2008 10:55 PM, Buz Barstow wrote: > Dear All, > > I'm looking for an algorithm that will allow me to derive a > transformation matrix that superimposes one set of orthogonal vectors > onto another set of orthogonal vectors, that I can then use to > transform another set of orthogonal vectors. > > Thanks! and all the best, > > --Buz > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > PyMOL-users mailing list > PyMOL-users@... > https://lists.sourceforge.net/lists/listinfo/pymol-users > -- Tsjerk A. Wassenaar, Ph.D. Junior UD (post-doc) Biomolecular NMR, Bijvoet Center Utrecht University Padualaan 8 3584 CH Utrecht The Netherlands P: +31-30-2539931 F: +31-30-2537623 ```