/* * Plane.hpp * * Created on: Apr 7, 2010 * Author: crueger */ #ifndef PLANE_HPP_ #define PLANE_HPP_ #include #include #include #include "Space.hpp" #include "Exceptions/LinearDependenceException.hpp" #include "Exceptions/ZeroVectorException.hpp" class Vector; class Line; class Plane : public Space { typedef std::auto_ptr vec_ptr; public: Plane(const Vector &y1, const Vector &y2, const Vector &y3) throw(LinearDependenceException); Plane(const Vector &y1, const Vector &y2, double _offset) throw(ZeroVectorException,LinearDependenceException); Plane(const Vector &_normalVector, double _offset) throw(ZeroVectorException); Plane(const Vector &_normalVector, const Vector &_offsetVector) throw(ZeroVectorException); Plane(const Plane& plane); virtual ~Plane(); // Accessor Functions /** * returns normal Vector for a plane */ Vector getNormal() const; /** * returns the distance of the plane from the origin */ double getOffset() const; /** * returns a vector that points on the plane. * Same as getOffset()*getNormal(); */ Vector getOffsetVector() const; /** * returns three seperate points on this plane */ std::vector getPointsOnPlane() const; // some calculations Vector GetIntersection(const Line &Line) const; Vector mirrorVector(const Vector &rhs) const; /** * get a Line that is orthogonal to this plane, going through a chosen * point. * * The point does not have to lie on the plane itself. */ Line getOrthogonalLine(const Vector &origin) const; /****** Methods inherited from Space ***********/ virtual double distance(const Vector &point) const; virtual Vector getClosestPoint(const Vector &point) const; private: vec_ptr normalVector; double offset; }; std::ostream &operator<< (std::ostream &ost,const Plane& p); #endif /* PLANE_HPP_ */