Remember that Kernel::RT and Kernel::FT denote a RingNumberType and a FieldNumberType, respectively. For the kernel model Cartesian<T>, the two types are the same. For the kernel model Homogeneous<T>, Kernel::RT is equal to T, and Kernel::FT is equal to Quotient<T>.
| |
An iterator for enumerating the
Cartesian
coordinates of a point.
|
| |||
introduces a variable p with
Cartesian
coordinates
(0,0).
| |||
| |||
introduces a point p initialized to (x,y).
| |||
| |||
introduces a point p initialized to (x,y)
provided RT supports construction from double.
| |||
| |||
introduces a point p initialized to (hx/hw,hy/hw).
| |||
| |||
introduces a point p initialized to (x,y).
|
|
| Test for equality. Two points are equal, iff their x and y coordinates are equal. The point can be compared with ORIGIN. |
|
| Test for inequality. The point can be compared with ORIGIN. |
There are two sets of coordinate access functions, namely to the homogeneous and to the Cartesian coordinates. They can be used independently from the chosen kernel model.
|
| returns the homogeneous x coordinate. |
|
| returns the homogeneous y coordinate. |
|
| returns the homogenizing coordinate. |
Note that you do not loose information with the homogeneous representation, because the FieldNumberType is a quotient.
|
| returns the Cartesian x coordinate, that is hx/hw. |
|
| returns the Cartesian y coordinate, that is hy/hw. |
The following operations are for convenience and for compatibility with higher dimensional points. Again they come in a Cartesian and in a homogeneous flavor.
|
|
returns the i'th homogeneous coordinate of p, starting with 0.
| ||
|
|
returns the i'th
Cartesian
coordinate of p, starting with 0.
| ||
|
|
returns cartesian(i).
| ||
|
| returns an iterator to the Cartesian coordinates of p, starting with the 0th coordinate. | ||
|
| returns an off the end iterator to the Cartesian coordinates of p. | ||
|
| returns the dimension (the constant 2). | ||
|
| returns a bounding box containing p. Note that bounding boxes are not parameterized with whatsoever. | ||
|
| |||
returns the point obtained by applying t on p. |
The following operations can be applied on points:
|
| returns true iff p is lexicographically smaller than q, i.e. either if p.x() < q.x() or if p.x() == q.x() and p.y() < q.y(). |
|
| returns true iff p is lexicographically greater than q. |
|
| returns true iff p is lexicographically smaller or equal to q. |
|
| returns true iff p is lexicographically greater or equal to q. |
|
| returns the difference vector between q and p. You can substitute ORIGIN for either p or q, but not for both. |
|
| |
returns the point obtained by translating p by the vector v. | ||
|
| |
returns the point obtained by translating p by the vector -v. |
The following declaration creates two points with Cartesian double coordinates.
Point_2< Cartesian<double> > p, q(1.0, 2.0);
The variable p is uninitialized and should first be used on the left hand side of an assignment.
p = q; std::cout << p.x() << " " << p.y() << std::endl;