Re: [Jmol-users] apply matrix to 3D coords
Why does it matter what the exact translation is -- the exact origin? Why not just arbitrarily assign (0,0,0) to A0'? Bob Timothy Driscoll wrote: >On May 11, 2007, at 2:09 PM, Bob Hanson wrote: > > > >>>original >>> ATOM 1ATOM 2d(2-1)M*d >>>x 3.95 3.86 -0.08 -1.25 >>>y 38.05 36.58 -1.48 0.59 >>>z 17.44 17.32 -0.11 0.53 >>> >>> >>>transformed >>> ATOM 1ATOM 2d(2-1) >>>x 52.94 51.69 -1.25 >>>y 50.01 50.6 0.59 >>>z 89.41 89.95 0.53 >>> >>> >>>that's good, but now I'm stuck. unapplying the translation does not >>>get me to the transformed coords. this makes me think that... >>> >>> >>> >>> >>Since M*(a2-a1) = (a2'-a1'), you simply add ATOM 1 coordinates now to >>that and get the transformed coordinates. >> >>That is, calling A an initial coordinate, A' its transformed >>coordinate, >>A0 the coordinate (3.95, 38.05, 17.44) and A0' (52.94, 50.01, 89.41), >>you have: >> >>A' = A0' + M*(A - A0) >> >>I think it probably doesn't matter what you use for A0'. >> >>Maybe I've lost the purpose of doing all this >> >> >> > >ack, but I won't know A0' when I do this for real. > >I'm trying to get from the original coords and the matrix, to the >transformed coordinates. (in this particular case, I do know the >transformed coordinates, but only because I'm trying to work out the >equations. normally I will not know them in advance.) > > > >tim > > - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] apply matrix to 3D coords
On May 11, 2007, at 2:09 PM, Bob Hanson wrote: >> original >> ATOM 1ATOM 2d(2-1)M*d >> x 3.95 3.86 -0.08 -1.25 >> y 38.05 36.58 -1.48 0.59 >> z 17.44 17.32 -0.11 0.53 >> >> >> transformed >> ATOM 1ATOM 2d(2-1) >> x 52.94 51.69 -1.25 >> y 50.01 50.6 0.59 >> z 89.41 89.95 0.53 >> >> >> that's good, but now I'm stuck. unapplying the translation does not >> get me to the transformed coords. this makes me think that... >> >> > Since M*(a2-a1) = (a2'-a1'), you simply add ATOM 1 coordinates now to > that and get the transformed coordinates. > > That is, calling A an initial coordinate, A' its transformed > coordinate, > A0 the coordinate (3.95, 38.05, 17.44) and A0' (52.94, 50.01, 89.41), > you have: > > A' = A0' + M*(A - A0) > > I think it probably doesn't matter what you use for A0'. > > Maybe I've lost the purpose of doing all this > ack, but I won't know A0' when I do this for real. I'm trying to get from the original coords and the matrix, to the transformed coordinates. (in this particular case, I do know the transformed coordinates, but only because I'm trying to work out the equations. normally I will not know them in advance.) tim -- Timothy Driscollem: [EMAIL PROTECTED] Virginia Bioinformatics Institute ph: 540-231-3007 Bioinformatics I: M-1 im: molvisions Washington St., Blacksburg, VA 24061 04-16-07. We will not forget you. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] apply matrix to 3D coords
I think you've got it now. Timothy Driscoll wrote: > >original > ATOM 1ATOM 2d(2-1)M*d >x 3.95 3.86 -0.08 -1.25 >y 38.05 36.58 -1.48 0.59 >z 17.44 17.32 -0.11 0.53 > > >transformed > ATOM 1ATOM 2d(2-1) >x 52.94 51.69 -1.25 >y 50.01 50.6 0.59 >z 89.41 89.95 0.53 > > >that's good, but now I'm stuck. unapplying the translation does not >get me to the transformed coords. this makes me think that... > > > Since M*(a2-a1) = (a2'-a1'), you simply add ATOM 1 coordinates now to that and get the transformed coordinates. That is, calling A an initial coordinate, A' its transformed coordinate, A0 the coordinate (3.95, 38.05, 17.44) and A0' (52.94, 50.01, 89.41), you have: A' = A0' + M*(A - A0) I think it probably doesn't matter what you use for A0'. Maybe I've lost the purpose of doing all this Bob >>Unless they also applied a zoom >> >> >> > >but I have no other data from the operation other than the matrix, >and the two coordinate sets. > > >tim > > - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] apply matrix to 3D coords
On May 11, 2007, at 7:46 AM, Bob Hanson wrote: > what you will need to know are two points in each case, not one. What > you don't know or aren't figuring in is the possibility that the > origin > has been shifted. Rotation requires a center. Maybe it's (0,0,0), > maybe > not. In Jmol what we have to do is: > > 1) apply a translation to set the "center of rotation" at (0,0,0) > 2) apply the rotation > 3) unapply the translation to set the center of rotation where it > belongs > > The fact that your two atoms have different distances to (0,0,0) > suggests immediately that you cannot skip steps (1) and (3). > > If you take instead the difference in coordinates between any two > atoms, > then you should see the rotation working. You've only supplied one > coordinate from each, so I am sticking my neck out here, but I suspect > that if you were to take the two data sets and in each case choose an > arbitrary atom -- perhaps this one would do -- and subtract off that > coordinate from every atom coord in its own set, so that these two > each > read (0,0,0) (and thus themselves automatically fulfill the matrix > transformation), then you will see the expected relationship. The only > question then is whether they left- or right-multiplied the matrix. > hi Bob, thanks for the explanation. that did indeed make sense, helped a lot, and worked...up to a point. I translated the atoms in the original structure, applied the matrix, and ended up with the same distance as I see between equivalent atoms in the transformed structure: original ATOM 1ATOM 2d(2-1)M*d x 3.95 3.86 -0.08 -1.25 y 38.05 36.58 -1.48 0.59 z 17.44 17.32 -0.11 0.53 transformed ATOM 1ATOM 2d(2-1) x 52.94 51.69 -1.25 y 50.01 50.6 0.59 z 89.41 89.95 0.53 that's good, but now I'm stuck. unapplying the translation does not get me to the transformed coords. this makes me think that... > Unless they also applied a zoom > but I have no other data from the operation other than the matrix, and the two coordinate sets. tim -- Timothy Driscollem: [EMAIL PROTECTED] Virginia Bioinformatics Institute ph: 540-231-3007 Bioinformatics I: M-1 im: molvisions Washington St., Blacksburg, VA 24061 04-16-07. We will not forget you. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] apply matrix to 3D coords
what you will need to know are two points in each case, not one. What you don't know or aren't figuring in is the possibility that the origin has been shifted. Rotation requires a center. Maybe it's (0,0,0), maybe not. In Jmol what we have to do is: 1) apply a translation to set the "center of rotation" at (0,0,0) 2) apply the rotation 3) unapply the translation to set the center of rotation where it belongs The fact that your two atoms have different distances to (0,0,0) suggests immediately that you cannot skip steps (1) and (3). If you take instead the difference in coordinates between any two atoms, then you should see the rotation working. You've only supplied one coordinate from each, so I am sticking my neck out here, but I suspect that if you were to take the two data sets and in each case choose an arbitrary atom -- perhaps this one would do -- and subtract off that coordinate from every atom coord in its own set, so that these two each read (0,0,0) (and thus themselves automatically fulfill the matrix transformation), then you will see the expected relationship. The only question then is whether they left- or right-multiplied the matrix. Unless they also applied a zoom That make sense? Bob Timothy Driscoll wrote: >On May 11, 2007, at 1:37 AM, Bob Hanson wrote: > > > >>See if by any chance going the other way works -- from the verified >>coordinates to the original. If that's the case, then you need the >>inverse of this matrix. >> >> >> >> >yeah, I've been trying stuff like this, kinda haphazardly, without >luck. for example: > > >coords before transformation: >ATOM 1 N PRO 6 3.948 38.053 17.436 1.00 >41.27 N > > >coord after transformation: >ATOM 1 N PRO B 6 52.942 50.009 89.414 1.00 41.27 > > >the matrix: > > 0.58 0.805 0.125 > 0.521-0.484 0.703 > 0.626-0.342 -0.7 > > > > > > >>Timothy Driscoll wrote: >> >> >> >>>On May 10, 2007, at 3:54 PM, Bob Hanson wrote: >>> >>> >>> >>> This is always a royal pain to get right. Certainly looks like a rotation matrix to me. It's got the right form. My guess is you put the vector on the right and multiply as: x' = m11*x + m12*y + m13*z across the top row of that matrix. Likewise for y' across the second. >>>that does not appear to work, no, and that's what confuses me. >>>(MUSTANG also outputs a pdb file with the aligned coordinates, which >>>I use as verification.) I've been trying to read some literature on >>>transformation matrices but most of them are 4x4, not 3x3? >>> >>>anyway, I'll keep looking. >>> >>>tim >>> >>> >>> >>> >>> >>> Timothy Driscoll wrote: >hi, > >I have two structures that I have aligned using a program called >MUSTANG. the program gives me a 3x3 transformation matrix like >this >one: > > 0.58 0.805 0.125 >0.521-0.484 0.703 >0.626-0.342 -0.7 > > >in order to superimpose my second structure onto the coordinate >system of the first, I am told that I should apply this matrix >to the >xyz coords of the second. I thought this could be done via a >simple >matrix multiplication, but apparently not. > >can anyone please suggest a reference that deals with this? > > > >thank you, > >tim > > > > > > -- --- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users >>>- >>> >>>This SF.net email is sponsored by DB2 Express >>>Download DB2 Express C - the FREE version of DB2 express and take >>>control of your XML. No limits. Just data. Click to get it now. >>>http://sourceforge.net/powerbar/db2/ >>>___ >>>Jmol-users mailing list >>>Jmol-users@lists.sourceforge.net >>>https://lists.sourceforge.net/lists/listinfo/jmol-users >>> >>> >>> >>> >>-- >>--- >>This SF.net email is sponsored by DB2 Express >>Download DB2 Express C - the FREE version of DB2 express and take >>control of your XML. No limits. Just data. Click to get it now. >>http://sourceforge.net/powerbar/db2/ >>___ >>Jmol-users mailing list >>Jmol-users@lists.sourceforge.net >>http
Re: [Jmol-users] apply matrix to 3D coords
On May 11, 2007, at 1:37 AM, Bob Hanson wrote: > See if by any chance going the other way works -- from the verified > coordinates to the original. If that's the case, then you need the > inverse of this matrix. > > yeah, I've been trying stuff like this, kinda haphazardly, without luck. for example: coords before transformation: ATOM 1 N PRO 6 3.948 38.053 17.436 1.00 41.27 N coord after transformation: ATOM 1 N PRO B 6 52.942 50.009 89.414 1.00 41.27 the matrix: 0.58 0.805 0.125 0.521-0.484 0.703 0.626-0.342 -0.7 > > Timothy Driscoll wrote: > >> On May 10, 2007, at 3:54 PM, Bob Hanson wrote: >> >> >>> This is always a royal pain to get right. Certainly looks like a >>> rotation matrix to me. >>> It's got the right form. My guess is you put the vector on the >>> right and >>> multiply as: >>> >>> x' = m11*x + m12*y + m13*z >>> >>> across the top row of that matrix. Likewise for y' across the >>> second. >>> >>> >>> >> >> that does not appear to work, no, and that's what confuses me. >> (MUSTANG also outputs a pdb file with the aligned coordinates, which >> I use as verification.) I've been trying to read some literature on >> transformation matrices but most of them are 4x4, not 3x3? >> >> anyway, I'll keep looking. >> >> tim >> >> >> >> >>> Timothy Driscoll wrote: >>> >>> >>> hi, I have two structures that I have aligned using a program called MUSTANG. the program gives me a 3x3 transformation matrix like this one: 0.58 0.805 0.125 0.521-0.484 0.703 0.626-0.342 -0.7 in order to superimpose my second structure onto the coordinate system of the first, I am told that I should apply this matrix to the xyz coords of the second. I thought this could be done via a simple matrix multiplication, but apparently not. can anyone please suggest a reference that deals with this? thank you, tim >>> >>> -- >>> --- >>> This SF.net email is sponsored by DB2 Express >>> Download DB2 Express C - the FREE version of DB2 express and take >>> control of your XML. No limits. Just data. Click to get it now. >>> http://sourceforge.net/powerbar/db2/ >>> ___ >>> Jmol-users mailing list >>> Jmol-users@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/jmol-users >>> >>> >> >> >> - >> >> This SF.net email is sponsored by DB2 Express >> Download DB2 Express C - the FREE version of DB2 express and take >> control of your XML. No limits. Just data. Click to get it now. >> http://sourceforge.net/powerbar/db2/ >> ___ >> Jmol-users mailing list >> Jmol-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/jmol-users >> >> > > > -- > --- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ___ > Jmol-users mailing list > Jmol-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jmol-users tim -- Timothy Driscollem: [EMAIL PROTECTED] Virginia Bioinformatics Institute ph: 540-231-3007 Bioinformatics I: M-1 im: molvisions Washington St., Blacksburg, VA 24061 04-16-07. We will not forget you. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] apply matrix to 3D coords
See if by any chance going the other way works -- from the verified coordinates to the original. If that's the case, then you need the inverse of this matrix. Timothy Driscoll wrote: >On May 10, 2007, at 3:54 PM, Bob Hanson wrote: > > >>This is always a royal pain to get right. Certainly looks like a >>rotation matrix to me. >>It's got the right form. My guess is you put the vector on the >>right and >>multiply as: >> >>x' = m11*x + m12*y + m13*z >> >>across the top row of that matrix. Likewise for y' across the second. >> >> >> > >that does not appear to work, no, and that's what confuses me. >(MUSTANG also outputs a pdb file with the aligned coordinates, which >I use as verification.) I've been trying to read some literature on >transformation matrices but most of them are 4x4, not 3x3? > >anyway, I'll keep looking. > >tim > > > > >>Timothy Driscoll wrote: >> >> >> >>>hi, >>> >>>I have two structures that I have aligned using a program called >>>MUSTANG. the program gives me a 3x3 transformation matrix like this >>>one: >>> >>> 0.58 0.805 0.125 >>> 0.521-0.484 0.703 >>> 0.626-0.342 -0.7 >>> >>> >>>in order to superimpose my second structure onto the coordinate >>>system of the first, I am told that I should apply this matrix to the >>>xyz coords of the second. I thought this could be done via a simple >>>matrix multiplication, but apparently not. >>> >>>can anyone please suggest a reference that deals with this? >>> >>> >>> >>>thank you, >>> >>>tim >>> >>> >>> >>> >>-- >>--- >>This SF.net email is sponsored by DB2 Express >>Download DB2 Express C - the FREE version of DB2 express and take >>control of your XML. No limits. Just data. Click to get it now. >>http://sourceforge.net/powerbar/db2/ >>___ >>Jmol-users mailing list >>Jmol-users@lists.sourceforge.net >>https://lists.sourceforge.net/lists/listinfo/jmol-users >> >> > > >- >This SF.net email is sponsored by DB2 Express >Download DB2 Express C - the FREE version of DB2 express and take >control of your XML. No limits. Just data. Click to get it now. >http://sourceforge.net/powerbar/db2/ >___ >Jmol-users mailing list >Jmol-users@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/jmol-users > > - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] apply matrix to 3D coords
give us a hint -- a couple of initial coordinates, a couple of final coordinates, the matrix Bob Timothy Driscoll wrote: >On May 10, 2007, at 3:54 PM, Bob Hanson wrote: > > >>This is always a royal pain to get right. Certainly looks like a >>rotation matrix to me. >>It's got the right form. My guess is you put the vector on the >>right and >>multiply as: >> >>x' = m11*x + m12*y + m13*z >> >>across the top row of that matrix. Likewise for y' across the second. >> >> >> > >that does not appear to work, no, and that's what confuses me. >(MUSTANG also outputs a pdb file with the aligned coordinates, which >I use as verification.) I've been trying to read some literature on >transformation matrices but most of them are 4x4, not 3x3? > >anyway, I'll keep looking. > >tim > > > > >>Timothy Driscoll wrote: >> >> >> >>>hi, >>> >>>I have two structures that I have aligned using a program called >>>MUSTANG. the program gives me a 3x3 transformation matrix like this >>>one: >>> >>> 0.58 0.805 0.125 >>> 0.521-0.484 0.703 >>> 0.626-0.342 -0.7 >>> >>> >>>in order to superimpose my second structure onto the coordinate >>>system of the first, I am told that I should apply this matrix to the >>>xyz coords of the second. I thought this could be done via a simple >>>matrix multiplication, but apparently not. >>> >>>can anyone please suggest a reference that deals with this? >>> >>> >>> >>>thank you, >>> >>>tim >>> >>> >>> >>> >>-- >>--- >>This SF.net email is sponsored by DB2 Express >>Download DB2 Express C - the FREE version of DB2 express and take >>control of your XML. No limits. Just data. Click to get it now. >>http://sourceforge.net/powerbar/db2/ >>___ >>Jmol-users mailing list >>Jmol-users@lists.sourceforge.net >>https://lists.sourceforge.net/lists/listinfo/jmol-users >> >> > > >- >This SF.net email is sponsored by DB2 Express >Download DB2 Express C - the FREE version of DB2 express and take >control of your XML. No limits. Just data. Click to get it now. >http://sourceforge.net/powerbar/db2/ >___ >Jmol-users mailing list >Jmol-users@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/jmol-users > > - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] apply matrix to 3D coords
On May 10, 2007, at 3:54 PM, Bob Hanson wrote: > This is always a royal pain to get right. Certainly looks like a > rotation matrix to me. > It's got the right form. My guess is you put the vector on the > right and > multiply as: > > x' = m11*x + m12*y + m13*z > > across the top row of that matrix. Likewise for y' across the second. > that does not appear to work, no, and that's what confuses me. (MUSTANG also outputs a pdb file with the aligned coordinates, which I use as verification.) I've been trying to read some literature on transformation matrices but most of them are 4x4, not 3x3? anyway, I'll keep looking. tim > > Timothy Driscoll wrote: > >> hi, >> >> I have two structures that I have aligned using a program called >> MUSTANG. the program gives me a 3x3 transformation matrix like this >> one: >> >> 0.58 0.805 0.125 >> 0.521-0.484 0.703 >> 0.626-0.342 -0.7 >> >> >> in order to superimpose my second structure onto the coordinate >> system of the first, I am told that I should apply this matrix to the >> xyz coords of the second. I thought this could be done via a simple >> matrix multiplication, but apparently not. >> >> can anyone please suggest a reference that deals with this? >> >> >> >> thank you, >> >> tim >> >> > > > -- > --- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > ___ > Jmol-users mailing list > Jmol-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jmol-users - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] apply matrix to 3D coords
This is always a royal pain to get right. Certainly looks like a rotation matrix to me. It's got the right form. My guess is you put the vector on the right and multiply as: x' = m11*x + m12*y + m13*z across the top row of that matrix. Likewise for y' across the second. Does that not work? Bob Timothy Driscoll wrote: >hi, > >I have two structures that I have aligned using a program called >MUSTANG. the program gives me a 3x3 transformation matrix like this >one: > > 0.58 0.805 0.125 > 0.521-0.484 0.703 > 0.626-0.342 -0.7 > > >in order to superimpose my second structure onto the coordinate >system of the first, I am told that I should apply this matrix to the >xyz coords of the second. I thought this could be done via a simple >matrix multiplication, but apparently not. > >can anyone please suggest a reference that deals with this? > > > >thank you, > >tim > > - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users