 CGAL::Direction_3<Kernel>

Definition

An object of the class Direction_3<Kernel> is a vector in the three-dimensional vector space 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.

Creation

 Direction_3 d ( Vector_3 v); introduces a direction d initialized with the direction of vector v. Direction_3 d ( Line_3 l); introduces the direction d of line l. Direction_3 d ( Ray_3 r); introduces the direction d of ray r. Direction_3 d ( Segment_3 s); introduces the direction d of segment s. Direction_3 d ( Kernel::RT x, Kernel::RT y, 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 d.delta ( int i) returns values, such that d== Direction_3<Kernel>(delta(0),delta(1),delta(2)).
 Precondition: : 0 ≤ i ≤ 2.

Kernel::RT d.dx () returns delta(0).
Kernel::RT d.dy () returns delta(1).
Kernel::RT d.dz () returns delta(2).

bool d.operator== ( e) Test for equality.
bool d.operator!= ( e) Test for inequality.

Direction_3<Kernel> d.operator- () The direction opposite to d.

Vector_3<Kernel> d.vector () returns a vector that has the same direction as d.

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