# include "util.h" # include "pdb.h" /* O output : ! Lsq > xyz(1) = 0.8081*x+ 0.4756*y+ 0.3475*z+ 92.2785 ! Lsq > xyz(2) = -0.4721*x+ 0.8758*y+ -0.1007*z+ 29.5923 ! Lsq > xyz(3) = -0.3522*x+ -0.0827*y+ 0.9322*z+ 7.7962 SimpleDumpRT output: 0.808105 0.475592 0.347534 -0.472112 0.875769 -0.100690 -0.352247 -0.082707 0.932246 92.278534 29.592318 7.796243 1.000000 */ /* ================= */ void RotateCoordinates(file_records * f, double ** R) /* ================= */ { int ii; for (ii=0; iiatomnum; ii++) { atom_record * a = f->atoms[ii] ; double X = a->x , Y = a->y , Z = a->z ; a->x = R[1][1] * X + R[1][2] * Y + R[1][3] * Z ; a->y = R[2][1] * X + R[2][2] * Y + R[2][3] * Z ; a->z = R[3][1] * X + R[3][2] * Y + R[3][3] * Z ; } } /* ============ */ void SimpleDumpRT(double **RotMat, double *TVect, double rms) /* ============ */ { # define FF "%9.6f" # define T "\t" fprintf(stderr,"Rotation[3,3] \\n Translation[3] \\n RMS[1] \n"); printf(FF T FF T FF "\n",RotMat[1][1],RotMat[1][2],RotMat[1][3]); printf(FF T FF T FF "\n",RotMat[2][1],RotMat[2][2],RotMat[2][3]); printf(FF T FF T FF "\n",RotMat[3][1],RotMat[3][2],RotMat[3][3]); printf(FF T FF T FF "\n",TVect[1],TVect[2],TVect[3]); printf(FF "\n",rms); # undef FF # undef T } /* ==================== */ void TranslateCoordinates(file_records * f, double * T) /* ==================== */ { int ii; for (ii=0; iiatomnum; ii++) { atom_record * a = f->atoms[ii] ; a->x += T[1]; a->y += T[2]; a->z += T[3]; } }