\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)

CGAL 4.8 - dD Geometry Kernel

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
List of all members | Related Functions
CGAL::Ray_d< Kernel > Class Template Reference
Kernel Objects

`#include <CGAL/Kernel_d/Ray_d.h>`

## Definition

An instance of data type `Ray_d` is a ray in \( d\)-dimensional Euclidean space.

It starts in a point called the source of `r` and it goes to infinity.

Implementation

Rays are implemented by a pair of points as an item type. All operations like creation, initialization, tests, direction calculation, input and output on a ray \( r\) take time \( O(r.dimension())\). `dimension()`, coordinate and point access, and identity test take constant time. The space requirement is \( O(r.dimension())\).

## Related Functions
(Note that these are not member functions.)
bool | parallel (const Ray_d< Kernel > &r1, const Ray_d< Kernel > &r2)
| returns true if the unoriented supporting lines of `r1` and `r2` are parallel and false otherwise. More...

## Types
typedef unspecified_type | LA
| the linear algebra layer.

## Creation
| Ray_d ()
| introduces some ray in \( d\)-dimensional space.
| Ray_d (Point_d< Kernel > p, Point_d< Kernel > q)
| introduces a ray through `p` and `q` and starting at `p`. More...
| Ray_d (Point_d< Kernel > p, Direction_d< Kernel > dir)
| introduces a ray starting in `p` with direction `dir`. More...
| Ray_d (Segment_d< Kernel > s)
| introduces a ray through `s.source()` and `s.target()` and starting at `s.source()`. More...

## Operations
int | dimension ()
| returns the dimension of the ambient space.
Point_d< Kernel > | source ()
| returns the source point of `r`.
Point_d< Kernel > | point (int i)
| returns a point on `r`. More...
Direction_d< Kernel > | direction ()
| returns the direction of `r`.
Line_d< Kernel > | supporting_line ()
| returns the supporting line of `r`.
Ray_d< Kernel > | opposite ()
| returns the ray with direction opposite to `r` and starting in `source`.
Ray_d< Kernel > | transform (const Aff_transformation_d< Kernel > &t)
| returns \( t(r)\). More...
Ray_d< Kernel > | operator+ (const Vector_d< Kernel > &v)
| returns `r+v`, i.e., `r` translated by vector \( v\). More...
bool | has_on (const Point_d< Kernel > &p)
| A point is on `r`, iff it is equal to the source of `r`, or if it is in the interior of `r`. More...

## Constructor & Destructor Documentation

template<typename Kernel >

CGAL::Ray_d< Kernel >::Ray_d | ( | Point_d< Kernel > | p,
|  | Point_d< Kernel > | q
| ) |  |

introduces a ray through `p` and `q` and starting at `p`.

Precondition
  \( p\) and \( q\) are distinct and have the same dimension.
  `p.dimension()==q.dimension()`.

template<typename Kernel >

CGAL::Ray_d< Kernel >::Ray_d | ( | Point_d< Kernel > | p,
|  | Direction_d< Kernel > | dir
| ) |  |

introduces a ray starting in `p` with direction `dir`.

Precondition
  `p` and `dir` have the same dimension and `dir` is not degenerate.
  `p.dimension()==dir.dimension()`.

template<typename Kernel >

CGAL::Ray_d< Kernel >::Ray_d | ( | Segment_d< Kernel > | s) |  |

introduces a ray through `s.source()` and `s.target()` and starting at `s.source()`.

Precondition
  \( s\) is not degenerate.

## Member Function Documentation

template<typename Kernel >

bool CGAL::Ray_d< Kernel >::has_on | ( | const Point_d< Kernel > & | p) |  |

A point is on `r`, iff it is equal to the source of `r`, or if it is in the interior of `r`.

Precondition
  `r.dimension()==p.dimension()`.

template<typename Kernel >

Ray_d<Kernel> CGAL::Ray_d< Kernel >::operator+ | ( | const Vector_d< Kernel > & | v) |  |

returns `r+v`, i.e., `r` translated by vector \( v\).

Precondition
  `r.dimension()==v.dimension()`.

template<typename Kernel >

Point_d<Kernel> CGAL::Ray_d< Kernel >::point | ( | int | i) |  |

returns a point on `r`.

`point(0)` is the source. `point(i)`, with \( i>0\), is different from the source.

Precondition
  \( i \geq0\).

template<typename Kernel >

Ray_d<Kernel> CGAL::Ray_d< Kernel >::transform | ( | const Aff_transformation_d< Kernel > & | t) |  |

returns \( t(r)\).

Precondition
  `r.dimension()==t.dimension()`.

## Friends And Related Function Documentation

template<typename Kernel >

bool parallel | ( | const Ray_d< Kernel > & | r1,
|  | const Ray_d< Kernel > & | r2
| ) |  |
| related

returns true if the unoriented supporting lines of `r1` and `r2` are parallel and false otherwise.

Precondition
  `r1.dimension()==r2.dimension()`.