An instance of data type Point_d<Kernel> is a point of Euclidean space in dimension d. A point p = (p0, ,p d - 1 ) in d-dimensional space can be represented by homogeneous coordinates (h0,h1, ,hd) of number type RT such that pi = hi/hd, which is of type FT. The homogenizing coordinate hd is positive.
We call pi, 0 ≤ i < d the i-th Cartesian coordinate and hi, 0 ≤ i ≤ d, the i-th homogeneous coordinate. We call d the dimension of the point.
Point_d<Kernel> p; | |||||
introduces a variable p of
type Point_d<Kernel>.
| |||||
Point_d<Kernel> p ( int d, Origin); | |||||
introduces a variable
p of type Point_d<Kernel> in d-dimensional space,
initialized to the origin.
| |||||
template <class InputIterator> | |||||
Point_d<Kernel> p ( int d, InputIterator first, InputIterator last); | |||||
introduces a variable
p of type Point_d<Kernel> in dimension d. If size [first,last) == d this creates a point with Cartesian coordinates
set [first,last). If size [first,last) == d+1 the range
specifies the homogeneous coordinates H = set [first,last) =
( ± h0, ± h1,
, ± hd) where the sign chosen is the
sign of hd.
| |||||
template <class InputIterator> | |||||
Point_d<Kernel> p ( int d, InputIterator first, InputIterator last, RT D); | |||||
introduces a
variable p of type Point_d<Kernel> in dimension d
initialized to the point with homogeneous coordinates as defined by
H = set [first,last) and D: ( ± H[0],
± H[1],
, ± H[d-1], ± D). The sign
chosen is the sign of D.
| |||||
Point_d<Kernel> p ( RT x, RT y, RT w = 1); | |||||
introduces a variable
p of type Point_d<Kernel> in 2-dimensional space.
| |||||
Point_d<Kernel> p ( RT x, RT y, RT z, RT w); | |||||
introduces a
variable p of type Point_d<Kernel> in 3-dimensional
space.
|
int | p.dimension () | returns the dimension of p. | ||
FT | p.cartesian ( int i) |
returns the i-th Cartesian
coordinate of p.
| ||
FT | p [ int i ] |
returns the i-th Cartesian
coordinate of p.
| ||
RT | p.homogeneous ( int i) |
returns the i-th homogeneous
coordinate of p.
| ||
Cartesian_const_iterator | p.cartesian_begin () | returns an iterator pointing to the zeroth Cartesian coordinate p0 of p. | ||
Cartesian_const_iterator | p.cartesian_end () | returns an iterator pointing beyond the last Cartesian coordinate of p. | ||
Homogeneous_const_iterator | p.homogeneous_begin () | returns an iterator pointing to the zeroth homogeneous coordinate h0 of p. | ||
Homogeneous_const_iterator | p.homogeneous_end () | returns an iterator pointing beyond the last homogeneous coordinate of p. | ||
Point_d<Kernel> | p.transform ( Aff_transformation_d<Kernel> t) | |||
returns t(p). |
Vector_d<Kernel> | p - Origin o | returns the vector p-O. | ||
Vector_d<Kernel> | p - q |
returns p -
q.
| ||
Point_d<Kernel> | p + Vector_d<Kernel> v |
returns p +
v.
| ||
Point_d<Kernel> | p - Vector_d<Kernel> v |
returns p -
v.
| ||
Point_d<Kernel>& | p += Vector_d<Kernel> v |
adds v
to p.
| ||
Point_d<Kernel>& | p -= Vector_d<Kernel> v |
subtracts
v from p.
| ||
bool | p == Origin | returns true if p is the origin. |
Points are implemented by arrays of RT items. All operations like creation, initialization, tests, point - vector arithmetic, input and output on a point p take time O(p.dimension()). dimension(), coordinate access and conversions take constant time. The space requirement for points is O(p.dimension()).