more work on read_data and write_data
This commit is contained in:
@ -627,7 +627,7 @@ void Domain::define_general_triclinic(double *avec_caller, double *bvec_caller,
|
||||
if (bvec1[2] > 0.0) theta2 = -theta2;
|
||||
MathExtra::axisangle_to_quat(xaxis,theta2,quat2);
|
||||
|
||||
// quat = transformation via single quat = quat2 * quat1
|
||||
// quat_g2r = transformation via single quat = quat2 * quat1
|
||||
// rotate_g2r = general to restricted transformation matrix
|
||||
// if dot < 0.0 (A x B not in C direction)
|
||||
// flip sign of z component of transform,
|
||||
@ -635,9 +635,8 @@ void Domain::define_general_triclinic(double *avec_caller, double *bvec_caller,
|
||||
// rotate_r2g = restricted to general transformation matrix
|
||||
// simply a transpose of rotate_g2r since orthonormal
|
||||
|
||||
double quat[4];
|
||||
MathExtra::quatquat(quat2,quat1,quat);
|
||||
MathExtra::quat_to_mat(quat,rotate_g2r);
|
||||
MathExtra::quatquat(quat2,quat1,quat_g2r);
|
||||
MathExtra::quat_to_mat(quat_g2r,rotate_g2r);
|
||||
|
||||
if (dot < 0.0) {
|
||||
rotate_g2r[2][0] = -rotate_g2r[2][0];
|
||||
@ -670,10 +669,11 @@ void Domain::define_general_triclinic(double *avec_caller, double *bvec_caller,
|
||||
printf("Rotvec1: %g %g %g\n",rot1[0],rot1[1],rot1[2]);
|
||||
printf("Theta2: %g\n",theta2);
|
||||
printf("Rotvec2: %g %g %g\n",xaxis[0],xaxis[1],xaxis[2]);
|
||||
printf("Quat: %g %g %g %g\n",quat[0],quat[1],quat[2],quat[3]);
|
||||
double angle = 2.0*acos(quat[0]);
|
||||
printf("Quat: %g %g %g %g\n",quat_g2r[0],quat_g2r[1],quat_g2r[2],quat_g2r[3]);
|
||||
double angle = 2.0*acos(quat_g2r[0]);
|
||||
printf("Theta: %g\n",angle);
|
||||
printf("Rotvec: %g %g %g\n",quat[1]/sin(0.5*angle),quat[2]/sin(0.5*angle),quat[3]/sin(0.5*angle));
|
||||
printf("Rotvec: %g %g %g\n",quat_g2r[1]/sin(0.5*angle),quat_g2r[2]/sin(0.5*angle),
|
||||
quat_g2r[3]/sin(0.5*angle));
|
||||
printf("Aprime: %g %g %g\n",aprime[0],aprime[1],aprime[2]);
|
||||
printf("Bprime: %g %g %g\n",bprime[0],bprime[1],bprime[2]);
|
||||
printf("Cprime: %g %g %g\n",cprime[0],cprime[1],cprime[2]);
|
||||
|
||||
Reference in New Issue
Block a user