Контрольная работа: Сглаженная поверхность для границы трех атомов в пространстве
Yc=j;
Zc=sqrt((r[1]+Rc)*(r[1]+Rc)-(x[1]-Xc)*(x[1]-Xc)-(y[1]-Yc)*(y[1]-Yc))+z[1];
nom=0;
xc1=(Xc-double(x[1]))*(Xc-double(x[1]));
yc1=(Yc-double(y[1]))*(Yc-double(y[1]));
zc1=(Zc-double(z[1]))*(Zc-double(z[1]));
xc2=(Xc-double(x[2]))*(Xc-double(x[2]));
yc2=(Yc-double(y[2]))*(Yc-double(y[2]));
zc2=(Zc-double(z[2]))*(Zc-double(z[2]));
xc3=(Xc-double(x[3]))*(Xc-double(x[3]));
yc3=(Yc-double(y[3]))*(Yc-double(y[3]));
zc3=(Zc-double(z[3]))*(Zc-double(z[3]));
dg1=sqrt(xc1+yc1+zc1)-double(r[1])-Rc;
dg2=sqrt(xc2+yc2+zc2)-double(r[2])-Rc;
dg3=sqrt(xc3+yc3+zc3)-double(r[3])-Rc;
if (abs(int(dg1))<=1) nom++;
if (abs(int(dg2))<=1) nom++;
if (abs(int(dg3))<=1) nom++;
if (nom==3) {break;}
Zc=z[1]-sqrt((r[1]+Rc)*(r[1]+Rc)-(x[1]-Xc)*(x[1]-Xc)-(y[1]-Yc)*(y[1]-Yc));
nom=0;
xc1=(Xc-double(x[1]))*(Xc-double(x[1]));
yc1=(Yc-double(y[1]))*(Yc-double(y[1]));
zc1=(Zc-double(z[1]))*(Zc-double(z[1]));
xc2=(Xc-double(x[2]))*(Xc-double(x[2]));
yc2=(Yc-double(y[2]))*(Yc-double(y[2]));
zc2=(Zc-double(z[2]))*(Zc-double(z[2]));
xc3=(Xc-double(x[3]))*(Xc-double(x[3]));
yc3=(Yc-double(y[3]))*(Yc-double(y[3]));