11.07.2015 Views

VMD User's Guide

VMD User's Guide

VMD User's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

–axiszamount [rad|deg|pi] – Adds a rotation about the z axis by the given amount to therotation matrix–axis{x yz} amount [rad|deg|pi] – Adds a rotation of the given amount about the givenvector to the rotation matrix–bond{x1 y1 z1} {x2 y2 z2} amount [rad|deg|pi] – Sets the center and offset transformationsto the first point, and defines a rotation about the bond axis by the given amount.–angle{x1 y1 z1} {x2 y2 z2} {x3 y3 z3} amount [rad|deg|pi] – Sets the center and offsettransformation to the second point, and defines a rotation about the axis perpendicular tothe plane made by the three points (the vector is computed from the cross product of thevector connecting the first two points with that connected the last two).10.3 Multiplying vectors and matricesThere are two commands to multiply a matrix and a vector, vectrans and coordtrans. Theyassume the vector is in column form and premultiply the matrix to the vector. If the vectorcontains four numbers, the two commands are identical. If the vector has three elements, a fourthis added; a 0 for vectrans and a 1 for coordtrans. The difference is that vectors are not affectedby translations during transformations, while coordinates are.• (C++) vectrans mv– Multiple the matrix m with the vector v (length 4); returns a vector• coordtrans mv– Multiple the matrix m with the coordinate v (length 3); returns a vectorExamples:vmd > vectrans [transaxis z 90] {1 0 0}-3.67321e-06 1.0 0.0vmd > vectrans [transvecinv {-3 4 -12}] {-3 4 -12}13.0 -1.8e-05 5.8e-0510.4 Misc. functions and valuesSeveral other terms are added to the vectors package. The first is the variable M PI, which containsthe value of pi.Examples:vmd > set M_PI3.14159265358979323846vmd > expr 90 * ($M_PI / 180)1.5708The functions trans from rot, trans to rot, trans from offset, andtrans to offset areused to get or set a transformation matrix from either a 3x3 rotation matrix or offset vector. Ascurrently designed, these assume there is no scaling in the matrix. The trans from offset isidentical to transoffset and is present for completeness.The last is find rotation value varname, which takes a variable name and extracts fromthe beginning of it those terms which describe an amount of rotation. The rest of the data in153

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

Saved successfully!

Ooh no, something went wrong!