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

3D Direction (CGAL_Direction_3)

Definition

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

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

CGAL_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 the i'th value of the slope of d.
Precondition: : 0 <=i <=2.
R::RT d.dx () returns the dx value of the slope of d.
R::RT d.dy () returns the dy value of the slope of d.
R::RT d.dz () returns the dz value of the slope of d.
bool d == e Test for equality.
bool d != e Test for inequality.
CGAL_Direction_3<R>
- d The direction opposite to d.
CGAL_Vector_3<R> d.vector () returns a vector that has the same direction as d.
CGAL_Direction_3<R>
d.transform ( CGAL_Aff_transformation_3<R> t)
returns the direction obtained by applying t on d.


Return to chapter: 3D Point, Vector and Direction
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The CGAL Project. Wed, January 20, 1999.