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

3D Affine Transformation (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

Aff_transformation_3<R> t ( const Translation, Vector_3<R> v);
introduces a translation by a vector v.


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


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 (
m00 m01 m02 m03
m10 m11 m12 m13
m20 m21 m22 m23
0 0 0 hw
)
. The part 1/hw(
m00 m01 m02
m10 m11 m12
m20 m21 m22
)
defines the scaling and rotational part of the transformation, while the vector 1/hw(
m03
m13
m23
)
contains the translational part.


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 (
m00 m01 m02 0
m10 m11 m12 0
m20 m21 m22 0
0 0 0 hw
)
, i.e. an affine transformation without translational part.

Operations

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

Class_3<R> transform(Aff_transformation_3<R> t).

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

Point_3<R> t.transform ( Point_3<R> p)
Vector_3<R> t.transform ( Vector_3<R> p)
Direction_3<R> t.transform ( Direction_3<R> p)
Plane_3<R> t.transform ( Plane_3<R> p)

CGAL provides four function operators for these member functions:

Point_3<R> t ( Point_3<R> p)
Vector_3<R> t ( Vector_3<R> p)
Direction_3<R> t ( Direction_3<R> p)
Plane_3<R> t ( Plane_3<R> p)

Aff_transformation_3<R>
t * s composes two affine transformations.

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 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.


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