From: Gianluca Interlandi (
Date: Wed Nov 26 2014 - 18:06:03 CST

Dear vmd list,

I noticed that I get slightly different results when I measure the
distance between two atoms using "measure bond" vs by measuring the length
of the vector between the two atoms. The difference is usually after the
4th decimal after the period. I read in the frames from a NAMD DCD and I
use, e.g.,:

set index1 [[atomselect top "name CA and resid 1"] get index]
set index2 [[atomselect top "name CA and resid 2"] get index]
measure bond {$index1 $index2} frame 100

which returns "12.263489723205566"

But if I calculate the length of the vector between the two atoms with:

set sel1 [atomselect top "name CA and resid 1" frame 100]
set sel2 [atomselect top "name CA and resid 2" frame 100]
set res1 [lindex [$sel1 get {x y z}] 0]
set res2 [lindex [$sel2 get {x y z}] 0]
veclength [vecsub $res2 $res1]

I get "12.26349001762006"

Just wondering how come I get two slightly different results? The frames
are read from a DCD file that should be double precision. Which of the two
methods should be in theory more precise?



Gianluca Interlandi, PhD
                     +1 (206) 685 4435

Research Assistant Professor at the Department of Bioengineering
at the University of Washington, Seattle WA U.S.A.