37 Plane3D() : a_(0.), b_(0.), c_(1.), d_(0.) {}
41 Plane3D(T a1, T b1, T c1, T d1) : a_(a1), b_(b1), c_(c1), d_(d1) {}
46 : a_(n.x()), b_(n.y()), c_(n.z()), d_(-n*p) {}
54 a_ = n.
x(); b_ = n.
y(); c_ = n.
z(); d_ = -n*p1;
64 : a_(p.a_), b_(p.b_), c_(p.c_), d_(p.d_) {}
73 a_ = p.
a_; b_ = p.
b_; c_ = p.
c_; d_ = p.
d_;
return *
this;
78 T
a()
const {
return a_; }
81 T
b()
const {
return b_; }
84 T
c()
const {
return c_; }
87 T
d()
const {
return d_; }
96 double ll = std::sqrt(a_*a_ + b_*b_ + c_*c_);
97 if (ll > 0.) { a_ /= ll; b_ /= ll; c_ /= ll, d_ /= ll; }
104 return a()*p.
x() +
b()*p.
y() +
c()*p.
z() +
d();
117 T k = -
d()/(
a()*
a()+
b()*
b()+
c()*
c());
124 return a() == p.
a() &&
b() == p.
b() &&
c() == p.
c() &&
d() == p.
d();
130 return a() != p.
a() ||
b() != p.
b() ||
c() != p.
c() ||
d() != p.
d();
138 d_ = -n*
point().transform(m); a_ = n.
x(); b_ = n.
y(); c_ = n.
z();
147 std::ostream & operator<<(std::ostream & os, const Plane3D<float> & p);
153 std::ostream & operator<<(std::ostream & os, const Plane3D<double> & p);
157 #ifdef ENABLE_BACKWARDS_COMPATIBILITY T distance(const Point3D< T > &p) const
Normal3D< T > normal() const
Plane3D< T > & normalize()
Plane3D(const Normal3D< T > &n, const Point3D< T > &p)
bool operator==(const Plane3D< T > &p) const
Point3D< T > point(const Point3D< T > &p) const
Plane3D< T > & operator=(const Plane3D< T > &p)
bool operator!=(const Plane3D< T > &p) const
Plane3D(T a1, T b1, T c1, T d1)
Plane3D(const Plane3D< float > &p)
Point3D< T > point() const
Plane3D(const Point3D< T > &p1, const Point3D< T > &p2, const Point3D< T > &p3)
Plane3D< T > & transform(const Transform3D &m)