Ignore:
Timestamp:
Apr 13, 2010, 1:22:42 PM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
e7ea64
Parents:
0f55b2
Message:

Prepared interface of Vector Class for transition to VectorComposites

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/vector_ops.cpp

    r0f55b2 r1f591b  
    121121  // normalise this vector with respect to axis
    122122  a.CopyVector(vec);
    123   a.ProjectOntoPlane(&axis);
     123  a.ProjectOntoPlane(axis);
    124124  // construct normal vector
    125125  try {
     
    135135  y.Scale(sin(alpha));
    136136  a.Scale(cos(alpha));
    137   res = vec.Projection(&axis);
     137  res = vec.Projection(axis);
    138138  // add scaled normal vector onto this vector
    139   res.AddVector(&y);
     139  res += y;
    140140  // add part in axis direction
    141   res.AddVector(&a);
     141  res += a;
    142142  return res;
    143143};
     
    197197  Vector parallel;
    198198  double factor = 0.;
    199   if (fabs(a.ScalarProduct(&b)*a.ScalarProduct(&b)/a.NormSquared()/b.NormSquared() - 1.) < MYEPSILON) {
     199  if (fabs(a.ScalarProduct(b)*a.ScalarProduct(b)/a.NormSquared()/b.NormSquared() - 1.) < MYEPSILON) {
    200200    parallel = Line1a - Line2a;
    201     factor = parallel.ScalarProduct(&a)/a.Norm();
     201    factor = parallel.ScalarProduct(a)/a.Norm();
    202202    if ((factor >= -MYEPSILON) && (factor - 1. < MYEPSILON)) {
    203203      res = Line2a;
     
    206206    } else {
    207207      parallel = Line1a - Line2b;
    208       factor = parallel.ScalarProduct(&a)/a.Norm();
     208      factor = parallel.ScalarProduct(a)/a.Norm();
    209209      if ((factor >= -MYEPSILON) && (factor - 1. < MYEPSILON)) {
    210210        res = Line2b;
     
    221221  double s;
    222222  Vector temp1, temp2;
    223   temp1.CopyVector(&c);
    224   temp1.VectorProduct(&b);
    225   temp2.CopyVector(&a);
    226   temp2.VectorProduct(&b);
     223  temp1 = c;
     224  temp1.VectorProduct(b);
     225  temp2 = a;
     226  temp2.VectorProduct(b);
    227227  Log() << Verbose(1) << "INFO: temp1 = " << temp1 << ", temp2 = " << temp2 << "." << endl;
    228228  if (fabs(temp2.NormSquared()) > MYEPSILON)
    229     s = temp1.ScalarProduct(&temp2)/temp2.NormSquared();
     229    s = temp1.ScalarProduct(temp2)/temp2.NormSquared();
    230230  else
    231231    s = 0.;
    232   Log() << Verbose(1) << "Factor s is " << temp1.ScalarProduct(&temp2) << "/" << temp2.NormSquared() << " = " << s << "." << endl;
     232  Log() << Verbose(1) << "Factor s is " << temp1.ScalarProduct(temp2) << "/" << temp2.NormSquared() << " = " << s << "." << endl;
    233233
    234234  // construct intersection
Note: See TracChangeset for help on using the changeset viewer.