Navigation: Up, Table of Contents, Bibliography, Index, Title Page

3D Direction (Direction_3)

Definition

An object of the class Direction_3 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.

#include <CGAL/Direction_3.h>

Creation

Direction_3<R> d ( Vector_3<R> v);
introduces a direction d initialised with the direction of vector v.


Direction_3<R> d ( R::RT x, R::RT y, R::RT z);
introduces a direction d initialised with the direction from the origin to the point with Cartesian coordinates (x, y, z).

Operations

R::RT d.delta ( int i) returns values, such that d== Direction_2<R>(delta(0),delta(1),delta(2)).
Precondition: : 0 i 2.

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

bool d == e Test for equality.
bool d != e Test for inequality.

Direction_3<R> - d The direction opposite to d.

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

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


Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The GALIA project. Jan 18, 2000.