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

CGAL::Point_d<R>

#include <CGAL/Point_d.h>

Definition

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

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.operator == ( q)
Equality test. Two points are equal if they have the same dimension and agree in all coordinates.

bool p.operator != ( 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.operator [] ( 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.

See Also

Kernel::Point_d


Next: Object
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
www.cgal.org. Aug 13, 2001.