Changeset 66ce7a for molecuilder


Ignore:
Timestamp:
Aug 19, 2009, 12:22:08 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
6c09a4
Parents:
da84d6
Message:

Replaced Vector::Projection() by Vector::ScalarProduct()

  • Projection before was just a return of the Vector::ScalarProduct(). We change it now, to make it return a projected vector, the counterpart to ProjectOntoPlane
Location:
molecuilder/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/boundary.cpp

    rda84d6 r66ce7a  
    308308
    309309      //*out << "Checking sign in quadrant : " << ProjectedVector.Projection(&AngleReferenceNormalVector) << "." << endl;
    310       if (ProjectedVector.Projection(&AngleReferenceNormalVector) > 0) {
     310      if (ProjectedVector.ScalarProduct(&AngleReferenceNormalVector) > 0) {
    311311        angle = 2. * M_PI - angle;
    312312      }
     
    804804      G = sqrt(((a + b + c) * (a + b + c) - 2 * (a * a + b * b + c * c)) / 16.); // area of tesselated triangle
    805805      x.MakeNormalVector(runner->second->endpoints[0]->node->node, runner->second->endpoints[1]->node->node, runner->second->endpoints[2]->node->node);
    806       x.Scale(runner->second->endpoints[1]->node->node->Projection(&x));
     806      x.Scale(runner->second->endpoints[1]->node->node->ScalarProduct(&x));
    807807      h = x.Norm(); // distance of CoG to triangle
    808808      PyramidVolume = (1. / 3.) * G * h; // this formula holds for _all_ pyramids (independent of n-edge base or (not) centered peak)
  • molecuilder/src/builder.cpp

    rda84d6 r66ce7a  
    188188          // remove the projection onto the rotation plane of the second angle
    189189          n.CopyVector(&y);
    190           n.Scale(first->x.Projection(&y));
     190          n.Scale(first->x.ScalarProduct(&y));
    191191          cout << "N1: ",
    192192          n.Output((ofstream *)&cout);
     
    197197          cout << endl;
    198198          n.CopyVector(&z);
    199           n.Scale(first->x.Projection(&z));
     199          n.Scale(first->x.ScalarProduct(&z));
    200200          cout << "N2: ",
    201201          n.Output((ofstream *)&cout);
  • molecuilder/src/tesselation.cpp

    rda84d6 r66ce7a  
    349349
    350350  // make it always point inward (any offset vector onto plane projected onto normal vector suffices)
    351   if (NormalVector.Projection(&OtherVector) > 0)
     351  if (NormalVector.ScalarProduct(&OtherVector) > 0.)
    352352    NormalVector.Scale(-1.);
    353353};
     
    737737          TrialVector.CopyVector(checker->second->node->node);
    738738          TrialVector.SubtractVector(A->second->node->node);
    739           distance = TrialVector.Projection(&PlaneVector);
     739          distance = TrialVector.ScalarProduct(&PlaneVector);
    740740          if (fabs(distance) < 1e-4) // we need to have a small epsilon around 0 which is still ok
    741741            continue;
     
    897897        TempVector.SubtractVector(baseline->second->endpoints[0]->node->node); // TempVector is vector on triangle plane pointing from one baseline egde towards center!
    898898        //*out << Verbose(2) << "Projection of propagation onto temp: " << PropagationVector.Projection(&TempVector) << "." << endl;
    899         if (PropagationVector.Projection(&TempVector) > 0) // make sure normal propagation vector points outward from baseline
     899        if (PropagationVector.ScalarProduct(&TempVector) > 0) // make sure normal propagation vector points outward from baseline
    900900          PropagationVector.Scale(-1.);
    901901        *out << Verbose(4) << "PropagationVector of base triangle is " << PropagationVector << endl;
     
    957957            TempVector.SubtractVector(Center);
    958958            // make it always point outward
    959             if (VirtualNormalVector.Projection(&TempVector) < 0)
     959            if (VirtualNormalVector.ScalarProduct(&TempVector) < 0)
    960960              VirtualNormalVector.Scale(-1.);
    961961            // calculate angle
     
    15301530        AddTesselationLine(TPS[0], TPS[1], 0);
    15311531      }
    1532       cout << Verbose(2) << "Projection is " << BTS->NormalVector.Projection(&Oben) << "." << endl;
     1532      cout << Verbose(2) << "Projection is " << BTS->NormalVector.ScalarProduct(&Oben) << "." << endl;
    15331533    }
    15341534    if (BTS != NULL) // we have created one starting triangle
  • molecuilder/src/tesselationhelpers.cpp

    rda84d6 r66ce7a  
    359359  HeightA.SubtractVector(&par.x1);
    360360
    361   t1 = HeightA.Projection(&SideA)/SideA.ScalarProduct(&SideA);
     361  t1 = HeightA.ScalarProduct(&SideA)/SideA.ScalarProduct(&SideA);
    362362
    363363  SideB.CopyVector(&par.x4);
     
    366366  HeightB.SubtractVector(&par.x3);
    367367
    368   t2 = HeightB.Projection(&SideB)/SideB.ScalarProduct(&SideB);
     368  t2 = HeightB.ScalarProduct(&SideB)/SideB.ScalarProduct(&SideB);
    369369
    370370  cout << Verbose(2) << "Intersection " << intersection << " is at "
Note: See TracChangeset for help on using the changeset viewer.