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.

Examples:vmd > vecdist -1.5 5.57.0vmd > vecdist {0 0 0} {3 4 0}5.0vmd > vecdist {0 1 2 3 4 5 6} {-6 -5 -4 -3 -2 -1 0}15.8745• vecinvert v – Returns the additive inverse of v (−v).Examples:vmd > vecinvert -11.111.1vmd > vecinvert {3 -4 5}-3 4 -5vmd > vecinvert {0 -1 2 -3}0 1 -2 310.2 Matrix routinesBecause matrices are rather large when expressed in text form, the following definitions are usedfor the examples.• transidentity – Returns the identity matrix.Example:vmd > transidentity{1.0 0.0 0.0 0.0} {0.0 1.0 0.0 0.0} {0.0 0.0 1.0 0.0} {0.0 0.0 0.0 1.0}• transtranspose m – Returns the matrix transpose of the given matrixExample:vmd > transtranspose {{0 1 2 3 4} {5 6 7 8} {9 10 11 12} {13 14 15 16}}{0 5 9 13} {1 6 10 14} {2 7 11 15} {3 8 12 16}• (C++) transmult m1 m2 [m3 ...matricesmn] – Returns the matrix multiplication of the givenExamples:vmd > set mat1 {{1 2 3 4} {-2 3 -4 5} {3 -4 5 -6} {4 5 -6 -7}}vmd > set mat2 {{1 0 0 0} {0 0.7071 -0.7071 0} {0 0.7071 0.7071 0} {0 0 0 1}}vmd > set mat3 {{0.866025 0 0 0} {0 1 0 0} {-0.5 0 0.866025 0} {0 0 0 1}}vmd > transmult $mat1 [transidentity]{1.0 2.0 3.0 4.0} {-2.0 3.0 -4.0 5.0} {3.0 -4.0 5.0 -6.0}{4.0 5.0 -6.0 -7.0}vmd > transmult $mat1 $mat2 $mat3{0.512475 3.5355 0.612366 4.0} {0.7428 -0.7071 -4.28656 5.0}{-0.58387 0.7071 5.5113 -6.0} {7.35315 -0.7071 -6.73603 -7.0}150

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

Saved successfully!

Ooh no, something went wrong!