Ignore:
Timestamp:
Oct 13, 2009, 4:42:58 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
6f9d14, 96d8dc
Parents:
9f73db
git-author:
Frederik Heber <heber@…> (10/13/09 16:14:49)
git-committer:
Frederik Heber <heber@…> (10/13/09 16:42:58)
Message:

Pair correlation analysis added.

Unit tests are working fine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/vector.cpp

    r9f73db r57cfb7  
    256256    return false;
    257257  }
     258};
     259
     260/** Calculates the minimum distance of this vector to the plane.
     261 * \param *out output stream for debugging
     262 * \param *PlaneNormal normal of plane
     263 * \param *PlaneOffset offset of plane
     264 * \return distance to plane
     265 */
     266double Vector::DistanceToPlane(ofstream *out, Vector *PlaneNormal, Vector *PlaneOffset)
     267{
     268  Vector temp;
     269
     270  // first create part that is orthonormal to PlaneNormal with withdraw
     271  temp.CopyVector(this);
     272  temp.SubtractVector(PlaneOffset);
     273  temp.MakeNormalVector(PlaneNormal);
     274  temp.Scale(-1.);
     275  // then add connecting vector from plane to point
     276  temp.AddVector(this);
     277  temp.SubtractVector(PlaneOffset);
     278
     279  return temp.Norm();
    258280};
    259281
Note: See TracChangeset for help on using the changeset viewer.