CGAL 5.5.3 - dD Geometry Kernel
CGAL::Hyperplane_d< Kernel > Class Template Reference

#include <CGAL/Kernel_d/Hyperplane_d.h>

Definition

An instance of data type Hyperplane_d is an oriented hyperplane in \( d\) - dimensional space.

A hyperplane \( h\) is represented by coefficients \( (c_0,c_1,\ldots,c_d)\) of type RT. At least one of \( c_0\) to \( c_{ d - 1 }\) must be non-zero. The plane equation is \( \sum_{ 0 \le i < d } c_i x_i + c_d = 0\), where \( x_0\) to \( x_{d-1}\) are Cartesian point coordinates. For a particular \( x\) the sign of \( \sum_{ 0 \le i < d } c_i x_i + c_d\) determines the position of a point \( x\) with respect to the hyperplane (on the hyperplane, on the negative side, or on the positive side).

There are two equality predicates for hyperplanes. The (weak) equality predicate (weak_equality) declares two hyperplanes equal if they consist of the same set of points, the strong equality predicate (operator==) requires in addition that the negative halfspaces agree. In other words, two hyperplanes are strongly equal if their coefficient vectors are positive multiples of each other and they are (weakly) equal if their coefficient vectors are multiples of each other.

Implementation

Hyperplanes are implemented by arrays of integers as an item type. All operations like creation, initialization, tests, vector arithmetic, input and output on a hyperplane \( h\) take time \( O(h.dimension())\). coordinate access and dimension() take constant time. The space requirement is \( O(h.dimension())\).

Related Functions

(Note that these are not member functions.)

bool weak_equality (const Hyperplane_d< Kernel > &h1, const Hyperplane_d< Kernel > &h2)
 test for weak equality. More...
 

Types

typedef unspecified_type LA
 the linear algebra layer.
 
typedef unspecified_type Coefficient_const_iterator
 a read-only iterator for the coefficients.
 

Creation

 Hyperplane_d ()
 introduces a variable h of type Hyperplane_d<Kernel>.
 
template<class InputIterator >
 Hyperplane_d (int d, InputIterator first, InputIterator last, RT D)
 introduces a variable h of type Hyperplane_d<Kernel> initialized to the hyperplane with coefficients set [first,last) and D. More...
 
template<class InputIterator >
 Hyperplane_d (int d, InputIterator first, InputIterator last)
 introduces a variable h of type Hyperplane_d<Kernel> initialized to the hyperplane with coefficients set [first,last). More...
 
template<class ForwardIterator >
 Hyperplane_d (ForwardIterator first, ForwardIterator last, Point_d< Kernel > o, Oriented_side side=ON_ORIENTED_BOUNDARY)
 constructs some hyperplane that passes through the points in set [first,last). More...
 
 Hyperplane_d (Point_d< Kernel > p, Direction_d< Kernel > dir)
 constructs the hyperplane with normal direction dir that passes through \( p\). More...
 
 Hyperplane_d (RT a, RT b, RT c)
 introduces a variable h of type Hyperplane_d<Kernel> in \( 2\)-dimensional space with equation \( ax+by+c=0\).
 
 Hyperplane_d (RT a, RT b, RT c, RT d)
 introduces a variable h of type Hyperplane_d<Kernel> in \( 3\)-dimensional space with equation \( ax+by+cz+d=0\).
 

Operations

int dimension ()
 returns the dimension of h.
 
RT operator[] (int i)
 returns the \( i\)-th coefficient of h. More...
 
RT coefficient (int i)
 returns the \( i\)-th coefficient of h. More...
 
Coefficient_const_iterator coefficients_begin ()
 returns an iterator pointing to the first coefficient.
 
Coefficient_const_iterator coefficients_end ()
 returns an iterator pointing beyond the last coefficient.
 
Vector_d< Kernelorthogonal_vector ()
 returns the orthogonal vector of h. More...
 
Direction_d< Kernelorthogonal_direction ()
 returns the orthogonal direction of h. More...
 
Oriented_side oriented_side (const Point_d< Kernel > &p)
 returns the side of the hyperplane h containing \( p\). More...
 
bool has_on (const Point_d< Kernel > &p)
 returns true iff point p lies on the hyperplane h. More...
 
bool has_on_boundary (const Point_d< Kernel > &p)
 returns true iff point p lies on the boundary of hyperplane h. More...
 
bool has_on_positive_side (const Point_d< Kernel > &p)
 returns true iff point p lies on the positive side of hyperplane h. More...
 
bool has_on_negative_side (const Point_d< Kernel > &p)
 returns true iff point p lies on the negative side of hyperplane h. More...
 
Hyperplane_d< Kerneltransform (const Aff_transformation_d< Kernel > &t)
 returns \( t(h)\). More...
 

Constructor & Destructor Documentation

◆ Hyperplane_d() [1/4]

template<typename Kernel >
template<class InputIterator >
CGAL::Hyperplane_d< Kernel >::Hyperplane_d ( int  d,
InputIterator  first,
InputIterator  last,
RT  D 
)

introduces a variable h of type Hyperplane_d<Kernel> initialized to the hyperplane with coefficients set [first,last) and D.

Precondition
size [first,last) == d.
Template Parameters
InputIteratorhas RT as value type.

◆ Hyperplane_d() [2/4]

template<typename Kernel >
template<class InputIterator >
CGAL::Hyperplane_d< Kernel >::Hyperplane_d ( int  d,
InputIterator  first,
InputIterator  last 
)

introduces a variable h of type Hyperplane_d<Kernel> initialized to the hyperplane with coefficients set [first,last).

Precondition
size [first,last) == d+1.
Template Parameters
InputIteratorhas RT as value type.

◆ Hyperplane_d() [3/4]

template<typename Kernel >
template<class ForwardIterator >
CGAL::Hyperplane_d< Kernel >::Hyperplane_d ( ForwardIterator  first,
ForwardIterator  last,
Point_d< Kernel o,
Oriented_side  side = ON_ORIENTED_BOUNDARY 
)

constructs some hyperplane that passes through the points in set [first,last).

If side is ON_POSITIVE_SIDE or ON_NEGATIVE_SIDE then o is on that side of the constructed hyperplane.

Precondition
A hyperplane with the stated properties must exist.
Template Parameters
ForwardIteratorhas Point_d<Kernel> as value type.

◆ Hyperplane_d() [4/4]

template<typename Kernel >
CGAL::Hyperplane_d< Kernel >::Hyperplane_d ( Point_d< Kernel p,
Direction_d< Kernel dir 
)

constructs the hyperplane with normal direction dir that passes through \( p\).

The direction dir points into the positive side.

Precondition
p.dimension()==dir.dimension() and dir is not degenerate.

Member Function Documentation

◆ coefficient()

template<typename Kernel >
RT CGAL::Hyperplane_d< Kernel >::coefficient ( int  i)

returns the \( i\)-th coefficient of h.

Precondition
\( 0 \leq i \leq d\).

◆ has_on()

template<typename Kernel >
bool CGAL::Hyperplane_d< Kernel >::has_on ( const Point_d< Kernel > &  p)

returns true iff point p lies on the hyperplane h.

Precondition
h.dimension() == p.dimension().

◆ has_on_boundary()

template<typename Kernel >
bool CGAL::Hyperplane_d< Kernel >::has_on_boundary ( const Point_d< Kernel > &  p)

returns true iff point p lies on the boundary of hyperplane h.

Precondition
h.dimension() == p.dimension().

◆ has_on_negative_side()

template<typename Kernel >
bool CGAL::Hyperplane_d< Kernel >::has_on_negative_side ( const Point_d< Kernel > &  p)

returns true iff point p lies on the negative side of hyperplane h.

Precondition
h.dimension() == p.dimension().

◆ has_on_positive_side()

template<typename Kernel >
bool CGAL::Hyperplane_d< Kernel >::has_on_positive_side ( const Point_d< Kernel > &  p)

returns true iff point p lies on the positive side of hyperplane h.

Precondition
h.dimension() == p.dimension().

◆ operator[]()

template<typename Kernel >
RT CGAL::Hyperplane_d< Kernel >::operator[] ( int  i)

returns the \( i\)-th coefficient of h.

Precondition
\( 0 \leq i \leq d\).

◆ oriented_side()

template<typename Kernel >
Oriented_side CGAL::Hyperplane_d< Kernel >::oriented_side ( const Point_d< Kernel > &  p)

returns the side of the hyperplane h containing \( p\).

Precondition
h.dimension() == p.dimension().

◆ orthogonal_direction()

template<typename Kernel >
Direction_d<Kernel> CGAL::Hyperplane_d< Kernel >::orthogonal_direction ( )

returns the orthogonal direction of h.

It points from the negative halfspace into the positive halfspace.

◆ orthogonal_vector()

template<typename Kernel >
Vector_d<Kernel> CGAL::Hyperplane_d< Kernel >::orthogonal_vector ( )

returns the orthogonal vector of h.

It points from the negative halfspace into the positive halfspace and its homogeneous coordinates are \( (c_0, \ldots, c_{d - 1},1)\).

◆ transform()

template<typename Kernel >
Hyperplane_d<Kernel> CGAL::Hyperplane_d< Kernel >::transform ( const Aff_transformation_d< Kernel > &  t)

returns \( t(h)\).

Precondition
h.dimension() == t.dimension().

Friends And Related Function Documentation

◆ weak_equality()

template<typename Kernel >
bool weak_equality ( const Hyperplane_d< Kernel > &  h1,
const Hyperplane_d< Kernel > &  h2 
)
related

test for weak equality.

Precondition
h1.dimension() == h2.dimension().