Page 40 Table of Contents Index Page 42
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E



CHAPTER 5. AFFINE TRANSFORMATIONS

formation is first, followed by the translation, scaling, or rotation "transformation".

dx and dy are as for make-translation-transformation. sx and sy are as for make-scaling-
transformation
. angle and origin are as for make-rotation-transformation.

Note that these functions could be implemented by using the various constructors and compose-
transformations
. They are provided, because it is common to build up a transformation as a
series of simple transformations.

5.3.3 Applying Transformations

Transforming a region applies a coordinate transformation to that region, thus moving its po-
sition on the drawing plane, rotating it, or scaling it. Note that transforming a region does
not side-effect the region argument; it is free to either create a new region or return an existing
(cached) region.

These generic functions must be implemented for all classes of transformations. Furthermore,
all subclasses of region and design must implement methods for transform-region and
untransform-region. That is, methods for the following generic functions will typically spe-
cialize both the transformation and region arguments.

=> transform-region transformation region [Generic Function]
Applies transformation to the region region, and returns the transformed region.

=> untransform-region transformation region [Generic Function]
This is exactly equivalent to
(transform-region (invert-transformation transformation) region) .

CLIM provides a default method for untransform-region on the transformation protocol
class that does exactly this.

=> transform-position transformation x y [Generic Function]
Applies the transformation transformation to the point whose coordinates are the real numbers
x and y, and returns two values, the transformed x coordinate and the transformed y coordinate.

transform-position is the spread version of transform-region in the case where the region
is a point.

=> untransform-position transformation x y [Generic Function]
This is exactly equivalent to
(transform-position (invert-transformation transformation) x y) .

CLIM provides a default method for untransform-position on the transformation protocol
class that does exactly this.


Page 40 Table of Contents Index Page 42
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E