![]() |
Remember that R::RT and R::FT denote a ring type and a field type. For the representation class Cartesian<T> the two types are the same. For the representation class Homogeneous<T> the ring type R::RT is equal to T, and the field type R::FT is equal to Quotient<T>.
| |
introduces a variable p with
Cartesian
coordinates
.
| |
| |
introduces a point p initialized to .
If the third argument is not explicitly given, it defaults
to R::RT(1). Precondition: hw R::RT(0)
|
|
| |
Test for equality. Two points are equal, iff their and 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 representation type R.
|
| returns the homogeneous coordinate. |
|
| returns the homogeneous coordinate. |
|
| returns the homogenizing coordinate. |
Here come the Cartesian access functions. Note that you do not loose information with the homogeneous representation, because then the field type is a quotient.
|
| returns the Cartesian coordinate, that is . |
|
| returns the Cartesian coordinate, that is . |
The following operations are for convenience and for making this point class compatible with code for higher dimensional points. Again they come in a Cartesian and homogeneous flavor.
|
| |
returns the i'th homogeneous coordinate of p, starting with 0. Precondition: . | ||
|
| |
returns the i'th
Cartesian
coordinate of p, starting with 0. Precondition: . | ||
|
| |
returns cartesian(i). Precondition: . | ||
|
| 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 on p. |
The following operations can be applied on points:
|
| |
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;