/* _______________________________________________________________________ * * RDPARM/PTRAJ: APR 2000 * _______________________________________________________________________ * * $Header: /thr/gamow/cvsroot/amber7/src/ptraj/vector.h,v 1.3 2000/05/10 21:52:02 cheatham Exp $ * * Revision: $Revision: 1.3 $ * Date: $Date: 2000/05/10 21:52:02 $ * Last checked in by $Author: cheatham $ * * This source is now archived under CVS at Scripps in the amber7 tree. * * NOTE: this is a beta, pre-release version, is under constant development, * probably contains some bugs and is under constant revision; therefore * take care. Please report bugs (and fixes!) to cheatham@chpc.utah.edu or * cheatham@cgl.ucsf.edu * * Do not distribute this code without explicit permission. * Do not incorporate into other codes without explicit permission. * * Current contact information: * * Thomas Cheatham, III * 2000 East, 30 South, Skaggs Hall 201 * Department of Medicinal Chemistry * University of Utah * Salt Lake City, UT 84112-5820 * cheatham@chpc.utah.edu * (801) 587-9653 * FAX: (801) 585-5366 * * Other contributors: * * David Case (Scripps) * Michael Crowley (Scripps) * Jed Pitera (UCSF) * Vickie Tsui (Scripps) * _______________________________________________________________________ */ /* T = U cross V */ #define VOP_3D_COORDS_CROSS_PRODUCT(TX,TY,TZ,UX,UY,UZ,VX,VY,VZ) \ TX = (UY * VZ) - (UZ * VY); \ TY = (UZ * VX) - (UX * VZ); \ TZ = (UX * VY) - (UY * VX) /* Multiply the 3x3 matrix times the coordinates specified * in x, y and z. xx, yy and zz are temporary variables. * The x, y and z arrays are modified! */ #define VOP_3x3_TIMES_COORDS(matrix, x, y, z, xx, yy, zz) \ xx = matrix[0][0] * x + \ matrix[0][1] * y + \ matrix[0][2] * z; \ yy = matrix[1][0] * x + \ matrix[1][1] * y + \ matrix[1][2] * z; \ zz = matrix[2][0] * x + \ matrix[2][1] * y + \ matrix[2][2] * z; \ x = xx; y = yy; z = zz /* Multiply the transpose of the 3x3 matrix times the * coordinates specified in x, y and z. xx, yy and zz * are temporary variables. * The x, y and z arrays are modified! */ #define VOP_3x3_TRANSPOSE_TIMES_COORDS(matrix, x, y, z, xx, yy, zz) \ xx = matrix[0][0] * x + matrix[1][0] * y + matrix[2][0] * z; \ yy = matrix[0][1] * x + matrix[1][1] * y + matrix[2][1] * z; \ zz = matrix[0][2] * x + matrix[1][2] * y + matrix[2][2] * z; \ x = xx; y = yy; z = zz #define VOP_3x3_TIMES_3x3(t, u, v) \ t[0][0] = u[0][0] * v[0][0] + u[0][1] * v[1][0] + u[0][2] * v[2][0]; \ t[0][1] = u[0][0] * v[0][1] + u[0][1] * v[1][1] + u[0][2] * v[2][1]; \ t[0][2] = u[0][0] * v[0][2] + u[0][1] * v[1][2] + u[0][2] * v[2][2]; \ t[1][0] = u[1][0] * v[0][0] + u[1][1] * v[1][0] + u[1][2] * v[2][0]; \ t[1][1] = u[1][0] * v[0][1] + u[1][1] * v[1][1] + u[1][2] * v[2][1]; \ t[1][2] = u[1][0] * v[0][2] + u[1][1] * v[1][2] + u[1][2] * v[2][2]; \ t[2][0] = u[2][0] * v[0][0] + u[2][1] * v[1][0] + u[2][2] * v[2][0]; \ t[2][1] = u[2][0] * v[0][1] + u[2][1] * v[1][1] + u[2][2] * v[2][1]; \ t[2][2] = u[2][0] * v[0][2] + u[2][1] * v[1][2] + u[2][2] * v[2][2]