#ifndef Plane_hpp
#define Plane_hpp

#include "Line.hpp"
#include "Matrix.hpp"

class Plane {
  double a;
  double b;
  double c;
  double d;
public:
  const static Plane XY;
  const static Plane XZ;
  const static Plane YZ;
  Plane(
    const Vector& n = Vector::Z,
    const Vector& o = Vector::Zero
  );
  Plane& set(
    const Vector& n,
    const Vector& o = Vector::Zero
  );
  Plane& set(const Line& l);
  const Vector& getNormal() const;
  const Vector& getCrossing(const Line& l) const;
  const Vector& getProjection(const Vector& v) const;
  const double getDistance(const Vector& p) const;
  const double getSin(const Line& l) const;
  const bool isFront(const Vector& v) const;
  const bool isBack(const Vector& v) const;
  Plane& operator *= (const Matrix& m);
};

#endif
