\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.6.1 - 2D and 3D Linear Geometry Kernel
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
CGAL::Plane_3< Kernel > Class Template Reference

#include <CGAL/Plane_3.h>

Definition

An object h of the data type Plane_3 is an oriented plane in the three-dimensional Euclidean space \( \E^3\).

It is defined by the set of points with Cartesian coordinates \( (x,y,z)\) that satisfy the plane equation

\[h :\; a\, x +b\, y +c\, z + d = 0.\]

The plane splits \( \E^3\) in a positive and a negative side. A point p with Cartesian coordinates \( (px, py, pz)\) is on the positive side of h, iff \( a\, px +b\, py +c\, pz + d > 0\). It is on the negative side, iff \( a\, px +b\, py\, +c\, pz + d < 0\).

See Also
Kernel::Plane_3

Creation

 Plane_3 (const Kernel::RT &a, const Kernel::RT &b, const Kernel::RT &c, const Kernel::RT &d)
 creates a plane h defined by the equation \( a\, px +b\, py +c\, pz + d = 0\). More...
 
 Plane_3 (const Point_3< Kernel > &p, const Point_3< Kernel > &q, const Point_3< Kernel > &r)
 creates a plane h passing through the points p, q and r. More...
 
 Plane_3 (const Point_3< Kernel > &p, const Vector_3< Kernel > &v)
 introduces a plane h that passes through point p and that is orthogonal to v.
 
 Plane_3 (const Point_3< Kernel > &p, const Direction_3< Kernel > &d)
 introduces a plane h that passes through point p and that has as an orthogonal direction equal to d.
 
 Plane_3 (const Line_3< Kernel > &l, const Point_3< Kernel > &p)
 introduces a plane h that is defined through the three points l.point(0), l.point(1) and p.
 
 Plane_3 (const Ray_3< Kernel > &r, const Point_3< Kernel > &p)
 introduces a plane h that is defined through the three points r.point(0), r.point(1) and p.
 
 Plane_3 (const Segment_3< Kernel > &s, const Point_3< Kernel > &p)
 introduces a plane h that is defined through the three points s.source(), s.target() and p.
 
 Plane_3 (const Circle_3< Kernel > &c)
 introduces a plane h that is defined as the plane containing the circle.
 

Operations

bool operator== (const Plane_3< Kernel > &h2) const
 Test for equality: two planes are equal, iff they have a non empty intersection and the same orientation.
 
bool operator!= (const Plane_3< Kernel > &h2) const
 Test for inequality.
 
Kernel::RT a () const
 returns the first coefficient of h.
 
Kernel::RT b () const
 returns the second coefficient of h.
 
Kernel::RT c () const
 returns the third coefficient of h.
 
Kernel::RT d () const
 returns the fourth coefficient of h.
 
Line_3< Kernelperpendicular_line (const Point_3< Kernel > &p) const
 returns the line that is perpendicular to h and that passes through point p. More...
 
Point_3< Kernelprojection (const Point_3< Kernel > &p) const
 returns the orthogonal projection of p on h.
 
Plane_3< Kernelopposite () const
 returns the plane with opposite orientation.
 
Point_3< Kernelpoint () const
 returns an arbitrary point on h.
 
Vector_3< Kernelorthogonal_vector () const
 returns a vector that is orthogonal to h and that is directed to the positive side of h.
 
Direction_3< Kernelorthogonal_direction () const
 returns the direction that is orthogonal to h and that is directed to the positive side of h.
 
Vector_3< Kernelbase1 () const
 returns a vector orthogonal to orthogonal_vector().
 
Vector_3< Kernelbase2 () const
 returns a vector that is both orthogonal to base1(), and to orthogonal_vector(), and such that the result of orientation( point(), point() + base1(), point()+base2(), point() + orthogonal_vector() ) is positive.
 

2D Conversion

The following functions provide conversion between a plane and CGAL's two-dimensional space.

The transformation is affine, but not necessarily an isometry. This means, the transformation preserves combinatorics, but not distances.

Point_2< Kernelto_2d (const Point_3< Kernel > &p) const
 returns the image point of the projection of p under an affine transformation, which maps h onto the \( xy\)-plane, with the \( z\)-coordinate removed.
 
Point_3< Kernelto_3d (const Point_2< Kernel > &p) const
 returns a point q, such that to_2d( to_3d( p )) is equal to p.
 

Predicates

Oriented_side oriented_side (const Point_3< Kernel > &p) const
 returns either ON_ORIENTED_BOUNDARY, or the constant ON_POSITIVE_SIDE, or the constant ON_NEGATIVE_SIDE, determined by the position of p relative to the oriented plane h.
 

Convenience Boolean Functions

bool has_on (const Point_3< Kernel > &p) const
 
bool has_on_positive_side (const Point_3< Kernel > &p) const
 
bool has_on_negative_side (const Point_3< Kernel > &p) const
 
bool has_on (const Line_3< Kernel > &l) const
 
bool has_on (const Circle_3< Kernel > &l) const
 
bool is_degenerate () const
 Plane h is degenerate, if the coefficients a, b, and c of the plane equation are zero.
 

Miscellaneous

Plane_3< Kerneltransform (const Aff_transformation_3< Kernel > &t) const
 returns the plane obtained by applying t on a point of h and the orthogonal direction of h.
 

Constructor & Destructor Documentation

template<typename Kernel >
CGAL::Plane_3< Kernel >::Plane_3 ( const Kernel::RT a,
const Kernel::RT b,
const Kernel::RT c,
const Kernel::RT d 
)

creates a plane h defined by the equation \( a\, px +b\, py +c\, pz + d = 0\).

Notice that h is degenerate if \( a = b = c = 0\).

template<typename Kernel >
CGAL::Plane_3< Kernel >::Plane_3 ( const Point_3< Kernel > &  p,
const Point_3< Kernel > &  q,
const Point_3< Kernel > &  r 
)

creates a plane h passing through the points p, q and r.

The plane is oriented such that p, q and r are oriented in a positive sense (that is counterclockwise) when seen from the positive side of h. Notice that h is degenerate if the points are collinear.

Member Function Documentation

template<typename Kernel >
Line_3<Kernel> CGAL::Plane_3< Kernel >::perpendicular_line ( const Point_3< Kernel > &  p) const

returns the line that is perpendicular to h and that passes through point p.

The line is oriented from the negative to the positive side of h.