CGAL 6.0 - 2D and 3D Linear Geometry Kernel
Searching...
No Matches
CGAL::Direction_3< Kernel > Class Template Reference

#include <CGAL/Direction_3.h>

## Definition

template<typename Kernel>
class CGAL::Direction_3< Kernel >

An object of the class Direction_3 is a vector in the three-dimensional vector space $$\mathbb{R}^3$$ where we forget about their length.

They can be viewed as unit vectors, although there is no normalization internally, since this is error prone. Directions are used whenever the length of a vector does not matter. They also characterize a set of parallel lines that have the same orientation or the direction normal to parallel planes that have the same orientation. For example, you can ask for the direction orthogonal to an oriented plane, or the direction of an oriented line.

Is model of
Kernel::Direction_3

## Creation

Direction_3 (const Vector_3< Kernel > &v)
introduces a direction d initialized with the direction of vector v.

Direction_3 (const Line_3< Kernel > &l)
introduces the direction d of line l.

Direction_3 (const Ray_3< Kernel > &r)
introduces the direction d of ray r.

Direction_3 (const Segment_3< Kernel > &s)
introduces the direction d of segment s.

Direction_3 (const Kernel::RT &x, const Kernel::RT &y, const Kernel::RT &z)
introduces a direction d initialized with the direction from the origin to the point with Cartesian coordinates $$(x, y, z)$$.

## Operations

Kernel::RT delta (int i) const
returns values, such that d== Direction_3<Kernel>(delta(0),delta(1),delta(2)).

Kernel::RT dx () const
returns delta(0).

Kernel::RT dy () const
returns delta(1).

Kernel::RT dz () const
returns delta(2).

bool operator== (const Direction_3< Kernel > &e) const
Test for equality.

bool operator!= (const Direction_3< Kernel > &e) const
Test for inequality.

Direction_3< Kerneloperator- () const
The direction opposite to d.

Vector_3< Kernelvector () const
returns a vector that has the same direction as d.

Direction_3< Kerneltransform (const Aff_transformation_3< Kernel > &t) const
returns the direction obtained by applying t on d.

## ◆ Direction_3() [1/2]

template<typename Kernel >
 CGAL::Direction_3< Kernel >::Direction_3 ( const Vector_3< Kernel > & v )

introduces a direction d initialized with the direction of vector v.

Exactness
This construction is trivial and therefore always exact in Exact_predicates_inexact_constructions_kernel.

## ◆ Direction_3() [2/2]

template<typename Kernel >
 CGAL::Direction_3< Kernel >::Direction_3 ( const Kernel::RT & x, const Kernel::RT & y, const Kernel::RT & z )

introduces a direction d initialized with the direction from the origin to the point with Cartesian coordinates $$(x, y, z)$$.

Exactness
This construction is trivial and therefore always exact in Exact_predicates_inexact_constructions_kernel.

## ◆ delta()

template<typename Kernel >
 Kernel::RT CGAL::Direction_3< Kernel >::delta ( int i ) const

returns values, such that d== Direction_3<Kernel>(delta(0),delta(1),delta(2)).

Precondition
0 <= i <= 2.
Exactness
This construction is trivial and therefore always exact in Exact_predicates_inexact_constructions_kernel.

## ◆ dx()

template<typename Kernel >
 Kernel::RT CGAL::Direction_3< Kernel >::dx ( ) const

returns delta(0).

Exactness
This construction is trivial and therefore always exact in Exact_predicates_inexact_constructions_kernel.

## ◆ dy()

template<typename Kernel >
 Kernel::RT CGAL::Direction_3< Kernel >::dy ( ) const

returns delta(1).

Exactness
This construction is trivial and therefore always exact in Exact_predicates_inexact_constructions_kernel.

## ◆ dz()

template<typename Kernel >
 Kernel::RT CGAL::Direction_3< Kernel >::dz ( ) const

returns delta(2).

Exactness
This construction is trivial and therefore always exact in Exact_predicates_inexact_constructions_kernel.

## ◆ operator-()

template<typename Kernel >
 Direction_3< Kernel > CGAL::Direction_3< Kernel >::operator- ( ) const

The direction opposite to d.

Exactness
This construction is trivial and therefore always exact in Exact_predicates_inexact_constructions_kernel.

## ◆ vector()

template<typename Kernel >
 Vector_3< Kernel > CGAL::Direction_3< Kernel >::vector ( ) const

returns a vector that has the same direction as d.

Exactness
This construction is trivial and therefore always exact in Exact_predicates_inexact_constructions_kernel.