VMD-L Mailing List
From: KM Tu (kmtu_at_nmr.kuicr.kyoto-u.ac.jp)
Date: Fri Sep 16 2011 - 10:33:49 CDT
- Next message: Hurt, Darrell (NIH/NIAID) [E]: "Re: Clustering MD trajectories"
- Previous message: Vijay Vammi: "Clustering MD trajectories"
- Next in thread: John Stone: "Re: A bug about "trans" command"
- Reply: John Stone: "Re: A bug about "trans" command"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Hello,
I believe I have found a bug about the Tcl "trans" command.
Fortunately, it should be easy to resolve, by modifying either the
source code or the VMD User’s Guide.
On the VMD User’s Guide Version 1.9 (March 9, 2011) page 166, it is
written that:
– center {x y z} – Sets the centering matrix so that point x y z is
brought to the origin
– offset {x y z} – Sets the offset matrix so that the origin is brought to x y z
– origin {x y z} – Sets both the centering and offset matrices to x y z
In other words, the User's Guide claims that:
setting origin = setting center + setting offset
But I found that it is not the truth. The truth should be:
setting center = setting origin + setting offset
We do not need any complex mathematics to verify this. Only some
simple logical tests are needed.
Relation test
============================
a)
vmd > coordtrans [trans origin {1 0 0} axis z 90] {0 0 1}
0.0 -1.0 1.0
vmd > coordtrans [trans center {1 0 0} offset {1 0 0} axis z 90] {0 0 1}
1.0 -1.0 1.0
b)
vmd > coordtrans [trans center {1 0 0} axis z 90] {0 0 1}
1.0 -1.0 1.0
vmd > coordtrans [trans origin {1 0 0} offset {1 0 0} axis z 90] {0 0 1}
1.0 -1.0 1.0
============================
>From a) we know, setting origin /= setting center + setting offset.
>From b) we get, setting center = setting origin + setting offset.
Furthermore, we can do the following test:
Dependency test
============================
c) center and offset are incommutable
vmd > coordtrans [trans center {1 0 0} offset {2 0 0} axis z 90] {0 0 1}
2.0 -1.0 1.0
vmd > coordtrans [trans offset {2 0 0} center {1 0 0} axis z 90] {0 0 1}
1.0 -1.0 1.0
d) center and origin are incommutable
vmd > coordtrans [trans center {1 0 0} origin {2 0 0} axis z 90] {0 0 1}
1.0 -2.0 1.0
vmd > coordtrans [trans origin {2 0 0} center {1 0 0} axis z 90] {0 0 1}
1.0 -1.0 1.0
e) origin and offset are commutable (independent)
vmd > coordtrans [trans origin {1 0 0} offset {2 0 0} axis z 90] {0 0 1}
2.0 -1.0 1.0
vmd > coordtrans [trans offset {2 0 0} origin {1 0 0} axis z 90] {0 0 1}
2.0 -1.0 1.0
============================
Therefore, it is obvious that it is "setting center" should include
"setting origin" and "setting offset". Either the User’s Guide or the
VMD program itself is wrong.
It took me a whole night to figure all this mess out. Please correct
me if I am wrong. Thank you.
KM Tu
- Next message: Hurt, Darrell (NIH/NIAID) [E]: "Re: Clustering MD trajectories"
- Previous message: Vijay Vammi: "Clustering MD trajectories"
- Next in thread: John Stone: "Re: A bug about "trans" command"
- Reply: John Stone: "Re: A bug about "trans" command"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]