CGAL 5.1 - dD Geometry Kernel
|
#include <CGAL/Kernel_d/Direction_d.h>
A Direction_d
is a vector in the \( d\)-dimensional vector space where we forget about its length. We represent directions in \( d\)-dimensional space as a tuple \( (h_0,\ldots,h_d)\) of variables of type RT
which we call the homogeneous coordinates of the direction. The coordinate \( h_d\) must be positive. The Cartesian coordinates of a direction are \( c_i = h_i/h_d\) for \( 0 \le i < d\), which are of type FT
. Two directions are equal if their Cartesian coordinates are positive multiples of each other. Directions are in one-to-one correspondence to points on the unit sphere.
Downward compatibility
We provide the operations of the lower dimensional interface dx()
, dy()
, dz()
.
Implementation
Directions are implemented by arrays of integers as an item type. All operations like creation, initialization, tests, inversion, input and output on a direction \( d\) take time \( O(d.\mathit{dimension}())\). dimension()
, coordinate access and conversion take constant time. The space requirement is \( O(d.\mathit{dimension}())\).
Types | |
typedef unspecified_type | LA |
the linear algebra layer. More... | |
typedef unspecified_type | Delta_const_iterator |
a read-only iterator for the deltas of dir . More... | |
typedef unspecified_type | Base_direction |
construction tag. More... | |
Creation | |
Direction_d () | |
introduces a variable dir of type Direction_d<Kernel> . More... | |
Direction_d (Vector_d< Kernel > v) | |
introduces a variable dir of type Direction_d<Kernel> initialized to the direction of v . More... | |
template<class InputIterator > | |
Direction_d (int d, InputIterator first, InputIterator last) | |
introduces a variable dir of type Direction_d<Kernel> in dimension d with representation tuple set [first,last) . More... | |
Direction_d (int d, Base_direction, int i) | |
returns a variable dir of type Direction_d<Kernel> initialized to the direction of the \( i\)-th base vector of dimension \( d\). More... | |
Direction_d (RT x, RT y) | |
introduces a variable dir of type Direction_d<Kernel> in \( 2\)-dimensional space. More... | |
Direction_d (RT x, RT y, RT z) | |
introduces a variable dir of type Direction_d<Kernel> in \( 3\)-dimensional space. More... | |
Operations | |
int | dimension () |
returns the dimension of dir . More... | |
RT | delta (int i) |
returns the \( i\)-th component of dir . More... | |
RT | operator[] (int i) |
returns the \( i\)-th delta of dir . More... | |
Delta_const_iterator | deltas_begin () |
returns an iterator pointing to the first delta of dir . More... | |
Delta_const_iterator | deltas_end () |
returns an iterator pointing beyond the last delta of dir . More... | |
Vector_d< Kernel > | vector () |
returns a vector pointing in direction dir . More... | |
bool | is_degenerate () |
returns true iff dir.delta(i)==0 for all \( 0\leq i < d\). More... | |
Direction_d< Kernel > | transform (const Aff_transformation_d< Kernel > &t) |
returns \( t(p)\). More... | |
Direction_d< Kernel > | opposite () |
returns the direction opposite to dir . More... | |
Direction_d< Kernel > | operator- () |
returns the direction opposite to dir . More... | |
typedef unspecified_type CGAL::Direction_d< Kernel >::Base_direction |
construction tag.
typedef unspecified_type CGAL::Direction_d< Kernel >::Delta_const_iterator |
a read-only iterator for the deltas of dir
.
typedef unspecified_type CGAL::Direction_d< Kernel >::LA |
the linear algebra layer.
CGAL::Direction_d< Kernel >::Direction_d | ( | ) |
introduces a variable dir
of type Direction_d<Kernel>
.
CGAL::Direction_d< Kernel >::Direction_d | ( | Vector_d< Kernel > | v | ) |
introduces a variable dir
of type Direction_d<Kernel>
initialized to the direction of v
.
CGAL::Direction_d< Kernel >::Direction_d | ( | int | d, |
InputIterator | first, | ||
InputIterator | last | ||
) |
introduces a variable dir
of type Direction_d<Kernel>
in dimension d
with representation tuple set [first,last)
.
d
is nonnegative, [first,last)
has d
elements. InputIterator | has RT as value type. |
CGAL::Direction_d< Kernel >::Direction_d | ( | int | d, |
Base_direction | , | ||
int | i | ||
) |
returns a variable dir
of type Direction_d<Kernel>
initialized to the direction of the \( i\)-th base vector of dimension \( d\).
CGAL::Direction_d< Kernel >::Direction_d | ( | RT | x, |
RT | y | ||
) |
introduces a variable dir
of type Direction_d<Kernel>
in \( 2\)-dimensional space.
CGAL::Direction_d< Kernel >::Direction_d | ( | RT | x, |
RT | y, | ||
RT | z | ||
) |
introduces a variable dir
of type Direction_d<Kernel>
in \( 3\)-dimensional space.
RT CGAL::Direction_d< Kernel >::delta | ( | int | i | ) |
returns the \( i\)-th component of dir
.
Delta_const_iterator CGAL::Direction_d< Kernel >::deltas_begin | ( | ) |
returns an iterator pointing to the first delta of dir
.
Delta_const_iterator CGAL::Direction_d< Kernel >::deltas_end | ( | ) |
returns an iterator pointing beyond the last delta of dir
.
int CGAL::Direction_d< Kernel >::dimension | ( | ) |
returns the dimension of dir
.
bool CGAL::Direction_d< Kernel >::is_degenerate | ( | ) |
returns true iff dir.delta(i)==0
for all \( 0\leq i < d\).
Direction_d<Kernel> CGAL::Direction_d< Kernel >::operator- | ( | ) |
returns the direction opposite to dir
.
RT CGAL::Direction_d< Kernel >::operator[] | ( | int | i | ) |
returns the \( i\)-th delta of dir
.
Direction_d<Kernel> CGAL::Direction_d< Kernel >::opposite | ( | ) |
returns the direction opposite to dir
.
Direction_d<Kernel> CGAL::Direction_d< Kernel >::transform | ( | const Aff_transformation_d< Kernel > & | t | ) |
returns \( t(p)\).
Vector_d<Kernel> CGAL::Direction_d< Kernel >::vector | ( | ) |
returns a vector pointing in direction dir
.