Changeset 465abf for molecuilder/src


Ignore:
Timestamp:
Apr 29, 2010, 4:11:43 PM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
c53e0b
Parents:
6a314f
Message:

Added a method that allows construction of three arbitrary points on a plane.

Location:
molecuilder/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/Plane.cpp

    r6a314f r465abf  
    9797  return getOffset()*getNormal();
    9898}
    99 /*
    100 std::vector<Vector> Plane::getPointsOnPlane(){
     99
     100vector<Vector> Plane::getPointsOnPlane(){
    101101  std::vector<Vector> res;
    102102  // first point on the plane
     
    104104  // first is orthogonal to the plane...
    105105  // an orthogonal vector to this one lies on the plane
    106   res[1] =
     106  Vector direction;
     107  direction.GetOneNormalVector(res[0]);
     108  res[1] = res[0]+direction;
     109  // get an orthogonal vector to direction and offset (lies on the plane)
     110  direction.VectorProduct(res[0]);
     111  direction.Normalize();
     112  res[2] = res[0] +direction;
     113  return res;
    107114}
    108 */
     115
    109116
    110117/** Calculates the intersection point between a line defined by \a *LineVector and \a *LineVector2 and a plane defined by \a *Normal and \a *PlaneOffset.
  • molecuilder/src/Plane.hpp

    r6a314f r465abf  
    1010
    1111#include <memory>
     12#include <vector>
    1213
    1314class Vector;
     
    3839  Vector getOffsetVector();
    3940
     41  /**
     42   * returns three seperate points on this plane
     43   */
     44  std::vector<Vector> getPointsOnPlane();
     45
    4046  // some calculations
    4147  Vector GetIntersection(const Vector &Origin, const Vector &LineVector);
Note: See TracChangeset for help on using the changeset viewer.