CGAL::Ray_3<Kernel>

Definition

An object r of the data type Ray_3<Kernel> is a directed straight ray in the three-dimensional Euclidean space 3. It starts in a point called the source of r and it goes to infinity.

Creation

Ray_3<Kernel> r ( Point_3<Kernel> p, Point_3<Kernel> q);
introduces a ray r with source p and passing through point q.


Ray_3<Kernel> r ( Point_3<Kernel> p, Direction_3<Kernel> d);
introduces a ray r with source p and with direction d.


Ray_3<Kernel> r ( Point_3<Kernel> p, Vector_3<Kernel> v);
introduces a ray r with source p and with a direction given by v.


Ray_3<Kernel> r ( Point_3<Kernel> p, Line_3<Kernel> l);
introduces a ray r starting at source p with the same direction as l.

Operations

bool r.operator== ( h) const Test for equality: two rays are equal, iff they have the same source and the same direction.

bool r.operator!= ( h) const Test for inequality.

Point_3<Kernel> r.source () const returns the source of r

Point_3<Kernel> r.point ( int i) const returns a point on r. point(0) is the source. point(i), with i>0, is different from the source.
Precondition: i 0.

Direction_3<Kernel> r.direction () const returns the direction of r.

Vector_3<Kernel> r.to_vector () const returns a vector giving the direction of r.

Line_3<Kernel> r.supporting_line () const returns the line supporting r which has the same direction.

Ray_3<Kernel> r.opposite () const returns the ray with the same source and the opposite direction.

bool r.is_degenerate () const ray r is degenerate, if the source and the second defining point fall together (that is if the direction is degenerate).

bool r.has_on ( Point_3<Kernel> p) const
A point is on r, iff it is equal to the source of r, or if it is in the interior of r.

Ray_3<Kernel> r.transform ( Aff_transformation_3<Kernel> t) const
returns the ray obtained by applying t on the source and on the direction of r.

See Also

Kernel::Ray_3