CGAL 4.7 - 2D and 3D Linear Geometry Kernel
|
#include <CGAL/Point_3.h>
An object of the class Point_3
is a point in the three-dimensional Euclidean space \( \E^3\).
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>
.
Operators
The following operations can be applied on points:
Kernel::Point_3
Related Functions | |
(Note that these are not member functions.) | |
bool | operator< (const Point_3< Kernel > &p, const Point_3< Kernel > &q) |
returns true iff p is lexicographically smaller than q (the lexicographical order being defined on the Cartesian coordinates). More... | |
bool | operator> (const Point_3< Kernel > &p, const Point_3< Kernel > &q) |
returns true iff p is lexicographically greater than q . More... | |
bool | operator<= (const Point_3< Kernel > &p, const Point_3< Kernel > &q) |
returns true iff p is lexicographically smaller or equal to q . More... | |
bool | operator>= (const Point_3< Kernel > &p, const Point_3< Kernel > &q) |
returns true iff p is lexicographically greater or equal to q . More... | |
Vector_3< Kernel > | operator- (const Point_3< Kernel > &p, const Point_3< Kernel > &q) |
returns the difference vector between q and p . More... | |
Point_3< Kernel > | operator+ (const Point_3< Kernel > &p, const Vector_3< Kernel > &v) |
returns the point obtained by translating p by the vector v . More... | |
Point_3< Kernel > | operator- (const Point_3< Kernel > &p, const Vector_3< Kernel > &v) |
returns the point obtained by translating p by the vector -v . More... | |
Types | |
typedef unspecified_type | Cartesian_const_iterator |
An iterator for enumerating the Cartesian coordinates of a point. More... | |
Creation | |
Point_3 (const Origin &ORIGIN) | |
introduces a point with Cartesian coordinates \( (0,0,0)\). More... | |
Point_3 (int x, int y, int z) | |
introduces a point p initialized to (x,y,z) . More... | |
Point_3 (double x, double y, double z) | |
introduces a point p initialized to (x,y,z) provided RT supports it. More... | |
Point_3 (const Kernel::RT &hx, const Kernel::RT &hy, const Kernel::RT &hz, const Kernel::RT &hw=RT(1)) | |
introduces a point p initialized to (hx/hw,hy/hw, hz/hw) . More... | |
Point_3 (const Kernel::FT &x, const Kernel::FT &y, const Kernel::FT &z) | |
introduces a point p initialized to (x,y,z) . More... | |
Operations | |
bool | operator== (const Point_3< Kernel > &q) const |
Test for equality: Two points are equal, iff their \( x\), \( y\) and \( z\) coordinates are equal. More... | |
bool | operator!= (const Point_3< Kernel > &q) const |
Test for inequality. More... | |
Coordinate Access | |
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. Note that you do not loose information with the homogeneous representation, because the FieldNumberType is a quotient. | |
Kernel::RT | hx () const |
returns the homogeneous \( x\) coordinate. More... | |
Kernel::RT | hy () const |
returns the homogeneous \( y\) coordinate. More... | |
Kernel::RT | hz () const |
returns the homogeneous \( z\) coordinate. More... | |
Kernel::RT | hw () const |
returns the homogenizing coordinate. More... | |
Kernel::FT | x () const |
returns the Cartesian \( x\) coordinate, that is hx() /hw() . More... | |
Kernel::FT | y () const |
returns the Cartesian \( y\) coordinate, that is hy() /hw() . More... | |
Kernel::FT | z () const |
returns the Cartesian \( z\) coordinate, that is hz() /hw() . More... | |
Convenience Operators | |
The following operations are for convenience and for compatibility with code for higher dimensional points. Again they come in a Cartesian and in a homogeneous flavor. | |
Kernel::RT | homogeneous (int i) const |
returns the i'th homogeneous coordinate of p , starting with 0. More... | |
Kernel::FT | cartesian (int i) const |
returns the i'th Cartesian coordinate of p , starting with 0. More... | |
Kernel::FT | operator[] (int i) const |
returns cartesian(i) . More... | |
Cartesian_const_iterator | cartesian_begin () const |
returns an iterator to the Cartesian coordinates of p , starting with the 0th coordinate. More... | |
Cartesian_const_iterator | cartesian_end () const |
returns an off the end iterator to the Cartesian coordinates of p . More... | |
int | dimension () const |
returns the dimension (the constant 3). More... | |
Bbox_3 | bbox () const |
returns a bounding box containing p . More... | |
Point_3< Kernel > | transform (const Aff_transformation_3< Kernel > &t) const |
returns the point obtained by applying t on p . More... | |
typedef unspecified_type CGAL::Point_3< Kernel >::Cartesian_const_iterator |
An iterator for enumerating the Cartesian coordinates of a point.
CGAL::Point_3< Kernel >::Point_3 | ( | const Origin & | ORIGIN | ) |
introduces a point with Cartesian coordinates \( (0,0,0)\).
CGAL::Point_3< Kernel >::Point_3 | ( | int | x, |
int | y, | ||
int | z | ||
) |
introduces a point p
initialized to (x,y,z)
.
CGAL::Point_3< Kernel >::Point_3 | ( | double | x, |
double | y, | ||
double | z | ||
) |
introduces a point p
initialized to (x,y,z)
provided RT
supports it.
CGAL::Point_3< Kernel >::Point_3 | ( | const Kernel::RT & | hx, |
const Kernel::RT & | hy, | ||
const Kernel::RT & | hz, | ||
const Kernel::RT & | hw = RT(1) |
||
) |
introduces a point p
initialized to (hx/hw,hy/hw, hz/hw)
.
hw
\( \neq\) 0. CGAL::Point_3< Kernel >::Point_3 | ( | const Kernel::FT & | x, |
const Kernel::FT & | y, | ||
const Kernel::FT & | z | ||
) |
introduces a point p
initialized to (x,y,z)
.
Bbox_3 CGAL::Point_3< Kernel >::bbox | ( | ) | const |
returns a bounding box containing p
.
Kernel::FT CGAL::Point_3< Kernel >::cartesian | ( | int | i | ) | const |
returns the i'th Cartesian coordinate of p
, starting with 0.
Cartesian_const_iterator CGAL::Point_3< Kernel >::cartesian_begin | ( | ) | const |
returns an iterator to the Cartesian coordinates of p
, starting with the 0th coordinate.
Cartesian_const_iterator CGAL::Point_3< Kernel >::cartesian_end | ( | ) | const |
returns an off the end iterator to the Cartesian coordinates of p
.
int CGAL::Point_3< Kernel >::dimension | ( | ) | const |
returns the dimension (the constant 3).
Kernel::RT CGAL::Point_3< Kernel >::homogeneous | ( | int | i | ) | const |
returns the i'th homogeneous coordinate of p
, starting with 0.
Kernel::RT CGAL::Point_3< Kernel >::hw | ( | ) | const |
returns the homogenizing coordinate.
Kernel::RT CGAL::Point_3< Kernel >::hx | ( | ) | const |
returns the homogeneous \( x\) coordinate.
Kernel::RT CGAL::Point_3< Kernel >::hy | ( | ) | const |
returns the homogeneous \( y\) coordinate.
Kernel::RT CGAL::Point_3< Kernel >::hz | ( | ) | const |
returns the homogeneous \( z\) coordinate.
bool CGAL::Point_3< Kernel >::operator!= | ( | const Point_3< Kernel > & | q | ) | const |
Test for inequality.
bool CGAL::Point_3< Kernel >::operator== | ( | const Point_3< Kernel > & | q | ) | const |
Test for equality: Two points are equal, iff their \( x\), \( y\) and \( z\) coordinates are equal.
Kernel::FT CGAL::Point_3< Kernel >::operator[] | ( | int | i | ) | const |
returns cartesian(i)
.
Point_3<Kernel> CGAL::Point_3< Kernel >::transform | ( | const Aff_transformation_3< Kernel > & | t | ) | const |
returns the point obtained by applying t
on p
.
Kernel::FT CGAL::Point_3< Kernel >::x | ( | ) | const |
Kernel::FT CGAL::Point_3< Kernel >::y | ( | ) | const |
Kernel::FT CGAL::Point_3< Kernel >::z | ( | ) | const |
|
related |
returns the difference vector between q
and p
.
You can substitute ORIGIN
for either p
or q
, but not for both.
|
related |
returns true iff p
is lexicographically smaller than q
(the lexicographical order being defined on the Cartesian coordinates).
|
related |
returns true iff p
is lexicographically smaller or equal to q
.
|
related |
returns true iff p
is lexicographically greater than q
.