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

3D Affine Transformation (CGAL_Aff_transformation_3)

Definition

In three-dimensional space we have a 4× 4 matrix (mij). Entries m30, m31, and m32 are always zero and therefore do not appear in the constructors.

#include <CGAL/Aff_transformation_3.h>

Creation

CGAL_Aff_transformation_3<R> t ( const CGAL_Translation,
CGAL_Vector_3<R> v);
introduces a translation by a vector v.

CGAL_Aff_transformation_3<R> t ( const CGAL_Scaling,
R::RT s,
R::RT hw = RT(1));
introduces a scaling by a scale factor s/hw.

CGAL_Aff_transformation_3<R> t ( R::RT m00,
R::RT m01,
R::RT m02,
R::RT m03,
R::RT m10,
R::RT m11,
R::RT m12,
R::RT m13,
R::RT m20,
R::RT m21,
R::RT m22,
R::RT m23,
R::RT hw = RT(1));
introduces a general affine transformation of the matrix form . The part 1/ hw defines the scaling and rotational part of the transformation, while the vector 1/ hw contains the translational part.

CGAL_Aff_transformation_3<R> t ( R::RT m00,
R::RT m01,
R::RT m02,
R::RT m10,
R::RT m11,
R::RT m12,
R::RT m20,
R::RT m21,
R::RT m22,
R::RT hw = RT(1));
introduces a general linear transformation of the matrix form , i.e. an affine transformation without translational part.

Operations

Each class CGAL_Class_3<R> representing a geometric object in 3D has a member function:

CGAL_Class_3<R> transform(CGAL_Aff_transformation_3<R> t) .

The transformation classes provide a member function transform() for points, vectors, directions, and planes:

CGAL_Point_3<R> t.transform ( CGAL_Point_3<R> p)
CGAL_Vector_3<R> t.transform ( CGAL_Vector_3<R> p)
CGAL_Direction_3<R>
t.transform ( CGAL_Direction_3<R> p)
CGAL_Plane_3<R> t.transform ( CGAL_Plane_3<R> p)

CGAL provides four function operators for these member functions:

CGAL_Point_3<R> t ( CGAL_Point_3<R> p)
CGAL_Vector_3<R> t ( CGAL_Vector_3<R> p)
CGAL_Direction_3<R>
t ( CGAL_Direction_3<R> p)
CGAL_Plane_3<R> t ( CGAL_Plane_3<R> p)
CGAL_Aff_transformation_3<R>
t * s composes two affine transformations.
CGAL_Aff_transformation_3<R>
t.inverse () gives the inverse transformation.
bool t.is_even () returns true, if the transformation is not reflecting, i.e. the determinant of the involved linear transformation is non-negative.
bool t.is_odd () returns true, if the transformation is reflecting.

The matrix entries of a matrix representation of a CGAL_Aff_transformation_2<R> can be accessed trough the following member functions:

FT t.cartesian ( int i, int j)
FT t.m ( int i, int j)
returns entry mij in a matrix representation in which m33 is 1.
RT t.homogeneous ( int i, int j)
RT t.hm ( int i, int j)
returns entry mij in some fixed matrix representation.

For affine transformations no I/O operators are defined.


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