Navigation: Up, Table of Contents, Bibliography, Index, Title Page

dD Point (Point_d)

Definition

An object of the class Point_d<R> is a point in d-dimensional Euclidean space Ed, where d is arbitrary.

#include <CGAL/Point_d.h>

Creation

A Point_d<R> object can be created from an iterator range.

template <class InputIterator>
Point_d<R> p ( int dim, InputIterator first, InputIterator last);
if the range [first,last) contains dim elements, this creates a point with Cartesian coordinates as specified by the range. If [first,last) contains dim+1 elements, the range specifies the homogeneous coordinates of p.
Precondition: dim is nonnegative, [first,last) has dim or dim+1 elements, and the value types of first and last are R::RT.

Note: in case your compiler does not support member templates, CGAL provides the following specialized constructor.

Point_d<R> p ( int dim, const R::RT* first, const R::RT* last);

Operations

bool p == q Equality test. Two points are equal if they have the same dimension and agree in all coordinates.

bool p != q Test for inequality.

R::RT p.homogeneous ( int i)
returns the i'th homogeneous coordinate of p, starting with 0.
Precondition: 0 i d.

R::FT p.cartesian ( int i)
returns the i'th Cartesian coordinate of p, starting with 0.
Precondition: 0 i < d.

R::FT p [ int i] returns the i'th Cartesian coordinate of p, starting with 0.
Precondition: 0 i < d.

int p.dimension () returns the dimension d of p.


Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The GALIA project. Jan 18, 2000.