ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/SHAPES/RigidBody.cpp
(Generate patch)

Comparing trunk/SHAPES/RigidBody.cpp (file contents):
Revision 1271 by gezelter, Tue Jun 15 20:20:36 2004 UTC vs.
Revision 1276 by chrisfen, Thu Jun 17 21:27:38 2004 UTC

# Line 15 | Line 15 | void RigidBody::addAtom(VDWAtom* at) {
15   void RigidBody::addAtom(VDWAtom* at) {
16  
17    vec3 coords;
18  vec3 euler;
19  mat3x3 Atmp;
18  
19    myAtoms.push_back(at);
20    
# Line 175 | Line 173 | void RigidBody::calcRefCoords( ) {
173  
174   void RigidBody::calcRefCoords( ) {
175  
176 <  int i,j,k, it, n_linear_coords;
176 >  int i, j, it, n_linear_coords;
177    double mtmp;
178    vec3 apos;
179    double refCOM[3];
180    vec3 ptmp;
181    double Itmp[3][3];
182    double evals[3];
185  double evects[3][3];
183    double r, r2, len;
184  
185    // First, find the center of mass:
# Line 284 | Line 281 | void RigidBody::doEulerToRotMat(vec3 &euler, mat3x3 &m
281    }
282   }
283  
284 < void RigidBody::doEulerToRotMat(vec3 &euler, mat3x3 &myA ){
284 > void RigidBody::doEulerToRotMat(double euler[3], double myA[3][3] ){
285  
286    double phi, theta, psi;
287    
# Line 344 | Line 341 | void RigidBody::getEulerAngles(double myEuler[3]) {
341    
342    
343    double phi,theta,psi,eps;
344 <  double pi;
345 <  double cphi,ctheta,cpsi;
346 <  double sphi,stheta,spsi;
350 <  double b[3];
351 <  int flip[3];
352 <  
344 >  double ctheta;
345 >  double stheta;
346 >    
347    // set the tolerance for Euler angles and rotation elements
348    
349    eps = 1.0e-8;
# Line 398 | Line 392 | double RigidBody::min(double x, double  y) {  
392  
393   double RigidBody::min(double x, double  y) {  
394    return (x > y) ? y : x;
395 + }
396 +
397 + double RigidBody::findMaxExtent(){
398 +        int i;
399 +        double refAtomPos[3];
400 +        double maxExtent;
401 +        double tempExtent;
402 +        
403 +        //zero the extent variables
404 +        maxExtent = 0.0;
405 +        tempExtent = 0.0;
406 +        for (i=0; i<3; i++)
407 +                refAtomPos[i] = 0.0;
408 +        
409 +        //loop over all atoms
410 +        for (i=0; i<myAtoms.size(); i++){
411 +                getAtomRefCoor(refAtomPos, i);
412 +                tempExtent = sqrt(refAtomPos[0]*refAtomPos[0] + refAtomPos[1]*refAtomPos[1]
413 +                                                  + refAtomPos[2]*refAtomPos[2]);
414 +                if (tempExtent > maxExtent)
415 +                        maxExtent = tempExtent;
416 +        }
417 +        return maxExtent;
418   }
419  
420   void RigidBody::findCOM() {
# Line 406 | Line 423 | void RigidBody::findCOM() {
423    int j;
424    double mtmp;
425    double ptmp[3];
426 <  double vtmp[3];
410 <  
426 >  
427    for(j = 0; j < 3; j++) {
428      pos[j] = 0.0;
429    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines