Google

CCP4i Documentation for Programmers: Core Documentation

Contents

Vector and Matrix Arithmetic (src/vector.tcl)

vmult return vector (a list) which is vector a multiplied by factor b

Argument list: <a> <b>

a arbitary length vector

b any numerical value

vdotp return the dot product of two vectors

Argument list: <a> <b>

a,b vectors (Tcl lists) of the same, but any, length

vlen return the magnitude of the vector

Argument list: <a>

a arbitary length vector

vdist return the distance between two points

Argument list: <a> <b>

a,b two vectors (Tcl lists) of the same, but any, length which would usually be lngth 3 and represent two points in space

vadd return the sum of two vectors

Argument list: <a> <b>

a,b two vectors (Tcl lists) of the same, but any, length

vsub return the difference of two vectors

Argument list: <a> <b>

a,b two vectors (Tcl lists) of the same, but any, length

vcent return the average coordinate of a list of 2D coordinates

Argument list: <args>

a,b,c.. Any number of 2D coordinates (i.e. Tcl lists of two items)

vscal return vector (a list) which is vector v scaled by factor s

Argument list: <s> <v>

s any numerical value

v arbitary length vector

vrot Apply a rotation to a 2D coordinate

Argument list: <angl> <a>

angl rotation angle (radians)

a 2D coordinate (a Tcl list)

vmatmult apply rotation matrix rmat to vector a

Argument list: <rmat> <a>

rmat a 3*3 matrix (a Tcl list of lists)

a a vector of length 3 (a Tcl list)

vmirror apply a mirror transformation in x or y axis

Argument list: <a> <axis>

a a 2D coordinate (a Tcl list)

axis choice of axis for mirror inversion (should be 'x' or 'y')