| 48 |
|
A[2][1] = -cos(phi) * sin(theta); |
| 49 |
|
A[2][2] = cos(theta); |
| 50 |
|
|
| 51 |
– |
printf("A[2][x] = %lf\t%lf\t%lf\n", A[2][0], A[2][1], A[2][2]); |
| 52 |
– |
|
| 51 |
|
} |
| 52 |
|
|
| 53 |
|
void RigidBody::getQ( double q[4] ){ |
| 318 |
|
pAxisMat[i][0] = sU[i][maxAxis]; |
| 319 |
|
} |
| 320 |
|
|
| 321 |
+ |
|
| 322 |
|
//calculate the proper rotation matrix |
| 323 |
|
transposeMat3(pAxisMat, pAxisRotMat); |
| 324 |
|
|
| 325 |
|
|
| 327 |
– |
for (i=0; i<myAtoms.size(); i++){ |
| 328 |
– |
apos = refCoords[i]; |
| 329 |
– |
printf("%f\t%f\t%f\n",apos[0],apos[1],apos[2]); |
| 330 |
– |
} |
| 331 |
– |
|
| 326 |
|
//rotate the rigid body to the principle axis frame |
| 327 |
|
for (i = 0; i < myAtoms.size(); i++) { |
| 328 |
|
matVecMul3(pAxisRotMat, refCoords[i].vec, refCoords[i].vec); |
| 329 |
|
myAtoms[i]->setPos(refCoords[i].vec); |
| 330 |
|
} |
| 337 |
– |
|
| 338 |
– |
for (i=0; i<myAtoms.size(); i++){ |
| 339 |
– |
apos = refCoords[i]; |
| 340 |
– |
printf("%f\t%f\t%f\n",apos[0],apos[1],apos[2]); |
| 341 |
– |
} |
| 331 |
|
|
| 332 |
|
identityMat3(iMat); |
| 333 |
|
setA(iMat); |
| 334 |
+ |
|
| 335 |
+ |
//and resort the moments of intertia to match the new orientation |
| 336 |
+ |
for (i=0; i<3; i++) |
| 337 |
+ |
if (evals[i]<momIntTol) |
| 338 |
+ |
evals[i] = 0.0; |
| 339 |
+ |
I[0][0] = evals[maxAxis]; |
| 340 |
+ |
I[1][1] = evals[midAxis]; |
| 341 |
+ |
I[2][2] = evals[pAxis]; |
| 342 |
|
} |
| 343 |
|
|
| 344 |
|
void RigidBody::doEulerToRotMat(double euler[3], double myA[3][3] ){ |
| 545 |
|
return myAtoms[index]->getEps(); |
| 546 |
|
|
| 547 |
|
} |
| 548 |
+ |
|
| 549 |
+ |
char *RigidBody::getAtomBase(int index){ |
| 550 |
+ |
|
| 551 |
+ |
return myAtoms[index]->getBase(); |
| 552 |
+ |
|
| 553 |
+ |
} |