11.07.2015 Views

VMD User's Guide

VMD User's Guide

VMD User's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The decimal in ”1.0” is important since otherwise Tcl does integer division. Finally, this value isused to scale the sum of the coordinate vectors (with vecscale), which returns the new value, whichis itself returned as the result of the procedure.The center of mass function is slightly harder because you have to get the mass as well asthe x, y, z values, then break that up into to components. The formula for the center of mass is∑ mi x i / ∑ mass iproc center_of_mass {selection} {# some error checkingif {[$selection num] center_of_mass $selInfo) 0.912778 4.61792 2.78021The opposite of ”get” is ”set”. Many keywords (most notably, ”x”, ”y”, and ”z”) can be set tonew values. This allows, for instance, atom coordinates to be changed, the occupancy values to beupdated, or user forces to be added. You can also change the resname, segid, and so forth, whichmay be easier to do within <strong>VMD</strong> than, for example, editing a PDB file by hand.set sel [atomselect top "index 5"]$sel get {x y z}{1.450000 0.000000 0.000000}$set set {x y z} {{1.6 0 0}}159

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!