Navigation: Up, Table of Contents, Bibliography, Index, Title Page

CGAL::Plane_3<R>

Definition

An object h of the data type Plane_3<R> is an oriented plane in the three-dimensional Euclidean space 3. It is defined by the set of points with coordinates Cartesian (x,y,z) that satisfy the plane equation

h : a x + b y + c z + d = 0

The plane splits 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.

Creation

Plane_3<R> h ( R::RT a, R::RT b, R::RT c, R::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.


Plane_3<R> h ( Point_3<R> p, Point_3<R> q, Point_3<R> 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.


Plane_3<R> h ( Point_3<R> p, Direction_3<R> d);
introduces a plane h that passes through point p and that has as an orthogonal direction equal to d.


Plane_3<R> h ( Line_3<R> l, Point_3<R> p);
introduces a plane h that is defined through the three points l.point(0), l.point(1) and p.


Plane_3<R> h ( Ray_3<R> r, Point_3<R> p);
introduces a plane h that is defined through the three points r.point(0), r.point(1) and p.


Plane_3<R> h ( Segment_3<R> s, Point_3<R> p);
introduces a plane h that is defined through the three points s.source(), s.target() and p.

Operations

bool h.operator== ( h2)
Test for equality: two planes are equal, iff they have a non empty intersection and the same orientation.

bool h.operator!= ( h2)
Test for inequality.

R::RT h.a () returns the first coefficient of h.
R::RT h.b () returns the second coefficient of h.
R::RT h.c () returns the third coefficient of h.
R::RT h.d () returns the fourth coefficient of h.

Line_3<R> h.perpendicular_line ( Point_3<R> p)
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.

Point_3<R> h.projection ( Point_3<R> p)
returns the orthogonal projection of p on h.

Plane_3<R> h.opposite () returns the plane with opposite orientation.

Point_3<R> h.point () returns an arbitrary point on h.

Vector_3<R> h.orthogonal_vector ()
returns a vector that is orthogonal to h and that is directed to the positive side of h.

Direction_3<R> h.orthogonal_direction ()
returns the direction that is orthogonal to h and that is directed to the positive side of h.

Vector_3<R> h.base1 () returns a vector orthogonal to orthogonal_vector().

Vector_3<R> h.base2 () 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<R> h.to_2d ( Point_3<R> p)
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<R> h.to_3d ( Point_2<R> p)
returns a point q, such that to_2d( to_3d( p )) is equal to p.

Oriented_side h.oriented_side ( Point_3<R> p)
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.

Predicates

For convenience we provide the following boolean functions:

bool h.has_on ( Point_3<R> p)
bool h.has_on_positive_side ( Point_3<R> p)
bool h.has_on_negative_side ( Point_3<R> p)

bool h.has_on ( Line_3<R> l)

bool h.is_degenerate () Plane h is degenerate, if the coefficients a, b, and c of the plane equation are zero.

Miscellaneous

Plane_3<R> h.transform ( Aff_transformation_3<R> t)
returns the plane obtained by applying t on a point of h and the orthogonal direction of h.

See Also

Kernel::Plane_3


Next: Point_3<R>
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
www.cgal.org. Aug 13, 2001.