CGAL 6.1 - 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<NT>
, the two types are the same. For the kernel model Homogeneous<NT>
, Kernel::RT
is equal to NT
, and Kernel::FT
is equal to Quotient<NT>
.
Operators
The following operations can be applied on points:
Kernel::Point_3
Hashable
if Kernel
is a cartesian kernel and if Kernel::FT
is Hashable
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). | |
bool | operator> (const Point_3< Kernel > &p, const Point_3< Kernel > &q) |
returns true iff p is lexicographically greater than q . | |
bool | operator<= (const Point_3< Kernel > &p, const Point_3< Kernel > &q) |
returns true iff p is lexicographically smaller or equal to q . | |
bool | operator>= (const Point_3< Kernel > &p, const Point_3< Kernel > &q) |
returns true iff p is lexicographically greater or equal to q . | |
Vector_3< Kernel > | operator- (const Point_3< Kernel > &p, const Point_3< Kernel > &q) |
returns the difference vector between q and p . | |
Types | |
typedef unspecified_type | Cartesian_const_iterator |
An iterator for enumerating the Cartesian coordinates of a point. | |
Creation | |
Point_3 (const Origin &ORIGIN) | |
introduces a point with Cartesian coordinates \( (0,0,0)\). | |
Point_3 (int x, int y, int z) | |
introduces a point p initialized to (x,y,z) . | |
Point_3 (double x, double y, double z) | |
introduces a point p initialized to (x,y,z) provided RT supports it. | |
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) . | |
Point_3 (const Kernel::FT &x, const Kernel::FT &y, const Kernel::FT &z) | |
introduces a point p initialized to (x,y,z) . | |
Point_3 (const Kernel::Weighted_point_3 &wp) | |
introduces a point from a weighted point. | |
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. | |
bool | operator!= (const Point_3< Kernel > &q) const |
Test for inequality. | |
Point_3< Kernel > & | operator+= (const Vector_3< Kernel > &v) |
translates the point by the vector v . | |
Point_3< Kernel > & | operator-= (const Vector_3< Kernel > &v) |
translates the point by the vector -v . | |
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 lose information with the homogeneous representation, because the FieldNumberType is a quotient. | |
Kernel::RT | hx () const |
returns the homogeneous \( x\) coordinate. | |
Kernel::RT | hy () const |
returns the homogeneous \( y\) coordinate. | |
Kernel::RT | hz () const |
returns the homogeneous \( z\) coordinate. | |
Kernel::RT | hw () const |
returns the homogenizing coordinate. | |
Kernel::FT | x () const |
returns the Cartesian \( x\) coordinate, that is hx() /hw() . | |
Kernel::FT | y () const |
returns the Cartesian \( y\) coordinate, that is hy() /hw() . | |
Kernel::FT | z () const |
returns the Cartesian \( z\) coordinate, that is hz() /hw() . | |
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 . | |
Kernel::FT | cartesian (int i) const |
returns the i'th Cartesian coordinate of p . | |
Kernel::FT | operator[] (int i) const |
returns cartesian(i) . | |
Cartesian_const_iterator | cartesian_begin () const |
returns an iterator to the Cartesian coordinates of p , starting with the 0th coordinate. | |
Cartesian_const_iterator | cartesian_end () const |
returns an off the end iterator to the Cartesian coordinates of p . | |
int | dimension () const |
returns the dimension (the constant 3). | |
Bbox_3 | bbox () const |
returns a bounding box containing p . | |
Point_3< Kernel > | transform (const Aff_transformation_3< Kernel > &t) const |
returns the point obtained by applying t on p . | |
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 . | |
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 . | |
CGAL::Point_3< Kernel >::Point_3 | ( | const Origin & | ORIGIN | ) |
introduces a point with Cartesian coordinates \( (0,0,0)\).
Exact_predicates_inexact_constructions_kernel
.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.
Exact_predicates_inexact_constructions_kernel
.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 != 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)
.
Exact_predicates_inexact_constructions_kernel
.
|
explicit |
introduces a point from a weighted point.
explicit
keyword is used to avoid accidental implicit conversions between Point_3 and Weighted_point_3.Exact_predicates_inexact_constructions_kernel
.Bbox_3 CGAL::Point_3< Kernel >::bbox | ( | ) | const |
returns a bounding box containing p
.
Exact_predicates_inexact_constructions_kernel
.Kernel::FT CGAL::Point_3< Kernel >::cartesian | ( | int | i | ) | const |
returns the i'th Cartesian coordinate of p
.
0 <= i <= 2
.Exact_predicates_inexact_constructions_kernel
.Kernel::RT CGAL::Point_3< Kernel >::homogeneous | ( | int | i | ) | const |
returns the i'th homogeneous coordinate of p
.
0 <= i <= 3
. Kernel::FT CGAL::Point_3< Kernel >::operator[] | ( | int | i | ) | const |
returns cartesian(i)
.
0 <= i <= 2
.Exact_predicates_inexact_constructions_kernel
.Kernel::FT CGAL::Point_3< Kernel >::x | ( | ) | const |
returns the Cartesian \( x\) coordinate, that is hx()
/hw()
.
Exact_predicates_inexact_constructions_kernel
.Kernel::FT CGAL::Point_3< Kernel >::y | ( | ) | const |
returns the Cartesian \( y\) coordinate, that is hy()
/hw()
.
Exact_predicates_inexact_constructions_kernel
.Kernel::FT CGAL::Point_3< Kernel >::z | ( | ) | const |
returns the Cartesian \( z\) coordinate, that is hz()
/hw()
.
Exact_predicates_inexact_constructions_kernel
.