Пример #1
0
void Confo_Back::Construct_Mol_II(XYZ pre,XYZ cur,XYZ nxt,double bend,double tort,double dist,XYZ &out)
{
	XYZ xyz;
	double x[3],y[3];
	double z[3];
	double cb1[3],cb2[3];
	xyz=nxt-cur;
	xyz.xyz2double(x);
	xyz=cur-pre;
	xyz.xyz2double(y);
	//check
	double angle=Vector_Angle(x,y,3);
	if(fabs(angle)<1.e-3||fabs(angle-M_PI)<1.e-3)
	{
		x[0]+=0.05;
		x[2]-=0.05;
		y[0]-=0.05;
		y[2]+=0.05;
	}
	//calc
	cross(z,x,y);
	Universal_Rotation(z,bend,Confo_Back_ROT_TOT);
	Vector_Multiply(cb1,Confo_Back_ROT_TOT,x);
	Universal_Rotation(x,tort,Confo_Back_ROT_TOT);
	Vector_Multiply(cb2,Confo_Back_ROT_TOT,cb1);
	Vector_Normalize(cb2,3);
	Vector_Dot(cb2,dist,cb2,3);
	out.double2xyz(cb2);
	out+=nxt;
}
Пример #2
0
void Confo_Back::Construct_CB(XYZ N,XYZ Ca,XYZ C,double bend,double tort,double dist,XYZ &Cb)
{
	XYZ xyz;
	double x[3],y[3];
	double z[3];
	double cb1[3],cb2[3];
	xyz=C-Ca;
	xyz.xyz2double(x);
	xyz=Ca-N;
	xyz.xyz2double(y);
	cross(z,x,y);
	Universal_Rotation(z,-1.0*bend,Confo_Back_ROT_TOT);
	Vector_Multiply(cb1,Confo_Back_ROT_TOT,x);
	Universal_Rotation(x,-1.0*tort,Confo_Back_ROT_TOT);
	Vector_Multiply(cb2,Confo_Back_ROT_TOT,cb1);
	Vector_Normalize(cb2,3);
	Vector_Dot(cb2,dist,cb2,3);
	Cb.double2xyz(cb2);
	Cb+=Ca;
}
Пример #3
0
//===================== Recon_Beta ==================//
//given CA+CB, and AMI_Dist, update SC
void Confo_Beta::Recon_Beta_1(XYZ *CA,XYZ *CB,int moln,char *ami)  //return SC
{
	int i;
	XYZ xyz;
	double radii;
	double multi;
	double v[3];
	for(i=0;i<moln;i++)
	{
		xyz=(CB[i]-CA[i]);
		xyz.xyz2double(v);
		radii=dot(v,v);
		if(radii<1.e-3)continue;
		Vector_Normalize(v,3);
		multi=CB_AMI_Dist[ami[i]-'A'];
		if(multi<0.0)continue;
		Vector_Dot(v,multi,v,3);
		xyz.double2xyz(v);
		CB[i]=CA[i]+xyz;
	}
}
Пример #4
0
//input Confo_Angle (*dist,*bend,*tort), output XYZ_Type data_structure (*r)
//dist[0]    : -1.0;
//dist[1]-[n]: normal
//bend[0]-[1]: -9.9
//bend[2]-[n]: normal
//tort[0]-[2]: -9.9
//tort[3]-[n]: normal
void Confo_Lett::ctc_ori(double *dist,double *bend,double *tort,int n,XYZ *r,XYZ *init)
{
	int i;
	double radi;
	XYZ xyz;
	xyz=0.0;
	XYZ ori[3],pos[3];	

	//real_process//
	Matrix_Unit(cle_T_Back,1.0);
	for(i=0;i<n;i++)
	{
		if(dist==NULL)radi=3.8;
		else radi=dist[i];

		if(i==0)r[i]=0.0;
		else if(i==1)
		{
			r[i]=0.0;
			r[i].X=radi;
		}
		else if(i==2)
		{
			Universal_Rotation(cle_Z_Axis,bend[i],cle_R_Theta);
			Vector_Dot(cle_D_Back,radi,cle_X_Axis,3);
			Matrix_Multiply(cle_T_Pre,cle_T_Back,cle_R_Theta);
			Vector_Multiply(cle_D_Pre,cle_T_Pre,cle_D_Back);
			Matrix_Equal(cle_T_Back,cle_T_Pre);
			xyz.double2xyz(cle_D_Pre);
			r[i]=r[i-1]+xyz;
		}
		else
		{
			Universal_Rotation(cle_Z_Axis,bend[i],cle_R_Theta);
			Universal_Rotation(cle_X_Axis,tort[i],cle_R_Thor);
			Vector_Dot(cle_D_Back,radi,cle_X_Axis,3);
			Matrix_Multiply(cle_temp,cle_R_Thor,cle_R_Theta);
			Matrix_Multiply(cle_T_Pre,cle_T_Back,cle_temp);
			Vector_Multiply(cle_D_Pre,cle_T_Pre,cle_D_Back);
			Matrix_Equal(cle_T_Back,cle_T_Pre);
			xyz.double2xyz(cle_D_Pre);
			r[i]=r[i-1]+xyz;
		}
	}

	//whether do ini_vector
	if(init!=NULL && n>=3)
	{
		for(i=0;i<3;i++)
		{
			ori[i]=init[i];
			pos[i]=r[i];
		}
		Get_Initial(ori,pos,cle_r1,cle_r2);
		Matrix_Multiply(cle_T_Pre,cle_r2,cle_r1);
		for(i=0;i<n;i++)
		{
			r[i].xyz2double(cle_D_Back);			
			Vector_Multiply(cle_D_Pre,cle_T_Pre,cle_D_Back);
			xyz.double2xyz(cle_D_Pre);
			r[i]=ori[0]+xyz;
		}
	}
}