49 void DLM::doRotate(StuntDouble* sd, Vector3d& ji, RealType dt) {
50 RealType dt2 = 0.5 * dt;
53 RotMat3x3d A = sd->getA();
54 Mat3x3d I = sd->getI();
59 int i = sd->linearAxis();
63 angle = dt2 * ji[j] / I(j, j);
64 rotateStep(k, i, angle, ji, A);
66 angle = dt * ji[k] / I(k, k);
67 rotateStep(i, j, angle, ji, A);
69 angle = dt2 * ji[j] / I(j, j);
70 rotateStep(k, i, angle, ji, A);
74 angle = dt2 * ji[0] / I(0, 0);
75 rotateStep(1, 2, angle, ji, A);
78 angle = dt2 * ji[1] / I(1, 1);
79 rotateStep(2, 0, angle, ji, A);
82 angle = dt * ji[2] / I(2, 2);
83 rotateStep(0, 1, angle, ji, A);
86 angle = dt2 * ji[1] / I(1, 1);
87 rotateStep(2, 0, angle, ji, A);
90 angle = dt2 * ji[0] / I(0, 0);
91 rotateStep(1, 2, angle, ji, A);
97 void DLM::rotateStep(
int axes1,
int axes2, RealType angle, Vector3d& ji,
121 cosAngle = cos(angle);
122 sinAngle = sin(angle);
123 rot(axes1, axes1) = cosAngle;
124 rot(axes2, axes2) = cosAngle;
126 rot(axes1, axes2) = sinAngle;
127 rot(axes2, axes1) = -sinAngle;
static SquareMatrix< RealType, Dim > identity()
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.