This commit is contained in:
jtclemm
2024-08-09 15:32:14 -06:00
parent 1e41dfaeb9
commit 07ac930733

View File

@ -296,7 +296,7 @@ double BondBPMRotational::elastic_forces(int i1, int i2, int type, double r_mag,
c = q21[0] * q21[0] - q21[1] * q21[1] - q21[2] * q21[2] + q21[3] * q21[3]; c = q21[0] * q21[0] - q21[1] * q21[1] - q21[2] * q21[2] + q21[3] * q21[3];
theta = acos_limit(c); theta = acos_limit(c);
// Separately calculte magnitude of quaternion in x-y and out of x-y planes // Separately calculate magnitude of quaternion in x-y and out of x-y planes
// to avoid dividing by zero // to avoid dividing by zero
mag_out_plane = (q21[0] * q21[0] + q21[3] * q21[3]); mag_out_plane = (q21[0] * q21[0] + q21[3] * q21[3]);
mag_in_plane = (q21[1] * q21[1] + q21[2] * q21[2]); mag_in_plane = (q21[1] * q21[1] + q21[2] * q21[2]);