An instance of the data type Aff_transformation_d<Kernel> is an affine transformation of d-dimensional space. It is specified by a square matrix M of dimension d + 1. All entries in the last row of M except the diagonal entry must be zero; the diagonal entry must be non-zero. A point p with homogeneous coordinates (p[0], , p[d]) can be transformed into the point p.transform(A) = Mp, where A is an affine transformation created from M by the constructors below.
Aff_transformation_d<Kernel>::LA | |
the linear algebra layer.
| |
Aff_transformation_d<Kernel>::Matrix | |
the matrix type.
|
Aff_transformation_d<Kernel> t; | |||||
introduces some
transformation.
| |||||
Aff_transformation_d<Kernel> t ( int d, Identity_transformation); | |||||
introduces the identity transformation in
d-dimensional space.
| |||||
Aff_transformation_d<Kernel> t ( Matrix M); | |||||
introduces the
transformation of d-space specified by matrix M.
| |||||
template <typename Forward_iterator> | |||||
Aff_transformation_d<Kernel> t ( Scaling, Forward_iterator start, Forward_iterator end); | |||||
introduces the transformation of d-space
specified by a diagonal matrix with entries set [start,end) on
the diagonal (a scaling of the space).
| |||||
Aff_transformation_d<Kernel> t ( Translation, Vector_d<Kernel> v); | |||||
introduces the translation by vector v.
| |||||
Aff_transformation_d<Kernel> t ( int d, Scaling, RT num, RT den); | |||||
returns a scaling by a scale factor num/den.
| |||||
Aff_transformation_d<Kernel> t ( int d, Rotation, RT sin_num, RT cos_num, RT den, int e1 = 0, int e2 = 1); | |||||
returns a planar rotation
with sine and cosine values sin_num/den and cos_num/den
in the plane spanned by the base vectors be1 and be2 in
d-space. Thus the default use delivers a planar rotation in the
x-y plane.
| |||||
Aff_transformation_d<Kernel> t ( int d, Rotation, Direction_d<Kernel> dir, RT num, RT den, int e1 = 0, int e2 = 1); | |||||
returns a planar
rotation within a two-dimensional linear subspace. The subspace is
spanned by the base vectors be1 and be2 in d-space. The
rotation parameters are given by the 2-dimensional direction
dir, such that the difference between the sines and cosines of
the rotation given by dir and the approximated rotation are at
most num/den each.
|
int | t.dimension () | the dimension of the underlying space | ||
Matrix | t.matrix () | returns the transformation matrix | ||
Aff_transformation_d<Kernel> | t.inverse () |
returns the inverse
transformation.
| ||
Aff_transformation_d<Kernel> | t * s | composition of transformations. Note that transformations are not necessarily commutative. t*s is the transformation which transforms first by t and then by s. |
Affine Transformations are implemented by matrices of number type RT as a handle type. All operations like creation, initialization, input and output on a transformation t take time O(t.dimension()2). dimension() takes constant time. The operations for inversion and composition have the cubic costs of the used matrix operations. The space requirement is O(t.dimension()2).