Given are a transformation T (i.e. a rotation matrix (double rotmat[9]) and 3 displacements (double dispx, dispy, dispz)), and the x,y,z coordinates of a point p. The following code computes the nx,ny,nz coordinates of T(p): nx=rotmat[0]*x+ rotmat[1]*y + rotmat [2] *z+ dispx; ny=rotmat[3]*x+ rotmat[4]*y + rotmat [5] *z+ dispy; nz=rotmat[6]*x + rotmat[7]*y + rotmat [8] *z+ dispz;