Remember that R::RT and R::FT denote a ring type and a field type. For the representation class CGAL_Cartesian<T> , the two types are equivalent. However, for the representation class CGAL_Homogeneous<T> the ring type is R::RT is equal to T and the field type is R::FT is equal to CGAL_Quotient<T>.
#include <CGAL/Point_3.h>
| |
introduces a point with Cartesian coordinates.
| |
| |
introduces a point p initialized to
. If the third argument is not
explicitly given it defaults to R::RT(1).
|
|
| Test for equality: Two points are equal, iff their , and coordinates are equal. |
|
| Test for inequality. |
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 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 . |
|
| 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 3). |
|
| returns a bounding box containing p. |
|
| |
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 CGAL_ORIGIN for either or , but not both. |
|
| |
returns a point obtained by translating p by the vector v. | ||
|
| |
returns a point obtained by translating p by the vector v. |