[gmx-users] Conversion codes
Nguyen Hoang Phuong
phuong at theochem.uni-frankfurt.de
Fri Sep 30 09:18:21 CEST 2005
Hi Gia,
> I was wondering if anyone knows the conversion codes, which converts cartesian
> coordinates to interatomic (not internal) distances. I know this question is
> not related directly to Gromacs, but I would appreciate any answer on this
> question.
this is quite simple, just write your own small program. The code should
be like this:
for(i=1;i<N;i++){
for(j=i+1;j<=N;j++){
distance[i][j] = sqrt( (x[i]-x[j])*(x[i]-x[j]) + (y[i]-y[j])*(y[i]-y[j]) +
(z[i]-z[j])*(z[i]-z[j]) );
printf("distance %lf\n",distance[i][j]);
}
}
where x,y,z are Cartesian coordinates and N the number of atoms.
cheers,
Phuong
More information about the gromacs.org_gmx-users
mailing list