# include
# include
/*
This is my function to rotate a helix. I think it also translates
it centering the helix on the origin. I think to remember also
that I still had to solve the problem of specular images or
something like that, and I suspect there is something in the
function which does it but not quite. Thank you for the new
alignment. I have now a whole set of matrices of neighbors
with different measures and some ideas about a flexible
desriptor of the environment at each position and how to
choose it, which I would like to discuss with you sometimes,
maybe between tennis games.
*/
/*
vector = CAs of helix coming in
newvector = CAs of helix coming out
n = number of CAs
newc = rotation matrix
*/
double transform(double vector[][3],int n,double newvector[][3],double newc[][3])
{
int i,j;
double
error=0.0,segno,
A,B,C,K,Xx,Xy,Xz,Yx,Yy,Yz,Zx,Zy,Zz,distm,dist,
mx,my,mz,x0,y0,z0,d1,d2,
Sx=0.,Sy=0.,Sz=0.,Sxq=0.,Syq=0.,Szq=0.,Sxz=0.,Syz=0.;
for(i=0;i0. && !i)
{
newvector[i][2] = -newvector[i][2];
Xz = -Xz;
Yz = -Yz;
Zz = -Zz;
}
}
A = -(Xz+Yz)/Zz;
K=sqrt(1.+1.+A*A);
Xx = newc[0][0] = 1./K;
Yx = newc[1][0] = 1./K;
Zx = newc[2][0] = A/K;
for(i=0;i