3.5 The Transformations Used by CLIM

- Arguments:
*transformation1 transformation2*

- Summary:
- Returns a transformation that is the mathematical composition of its arguments. Composition is in right-to-left order; that is, the resulting transformation represents the effects of applying the transformation
*transformation2*followed by the transformation*transformation1*.

- Arguments:
*transformation*

- Summary:
- Returns a transformation that is the inverse of the transformation
*transformation*. The result of composing a transformation with its inverse is equal to the identity transformation. - If
*transformation*is singular,**invert-transformation**will signal the**singulartransformation**error, with a named restart that is invoked with a transformation and makes**invert-transformation**return that transformation. This is to allow a drawing application, for example, to use a generalized inverse to transform a region through a singular transformation. - Note that with finite-precision arithmetic there are several low-level conditions that might occur during the attempt to invert a singular or "almost singular" transformation. (These include computation of a zero determinant, floating-point underflow during computation of the determinant, or floating-point overflow during subsequent multiplication.)
**invert-transformation**signals the**singular-transformation**error for all of these cases.

- Arguments:
*transformation dx dy*

- Arguments:
*transformation sx sy*`&optional`

origin

- Arguments:
*transformation angle*`&optional`

origin

- Summary:
- These functions create a new transformation by composing the transformation
*transformation*with a given translation, scaling, or rotation, respectively. The order of composition is that the translation, scaling, or rotation "transformation" is first, followed by*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-rotationtransformation**.- Note that these functions could be implemented by using the various constructors. They are provided because it is common to build up a transformation as a series of simple transformations.

- Arguments:
*transformation dx dy*

- Arguments:
*transformation sx sy*`&optional`

origin

- Arguments:
*transformation angle*`&optional`

origin

- Summary:
- These functions create a new transformation by composing a given translation, scaling, or rotation, respectively, with the transformation
*transformation*. The order of composition is*transformation*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-rotationtransformation**.- 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.

In order to preserve referential transparency, these three forms apply the translation, rotation, or scaling transformation first, then the rest of the transformation from`(medium-transformation`

. That is, the following two forms would return the same transformation (assuming that the medium's transformation in the second example is the identity transformation):** medium)**

(compose-transformations (make-translation-transformationdxdy) (make-rotation-transformationangle)) (with-translation (mediumdxdy) (with-rotation (mediumangle) (medium-transformationmedium)))

- Arguments:
*(medium dx dy)*`&body`

body

- Summary:
- Establishes a translation on the medium
*medium*that translates by*dx*in the*x*direction and*dy*in the*y*direction, and then executes*body*with that transformation in effect. *dx*and*dy*are as for**make-translation-transformation**.- The
*medium*argument is not evaluated, and must be a symbol that is bound to a sheet or medium. If*medium*is**t**,***standard-output***is used.*body*may have zero or more declarations as its first forms.

- Arguments:
*(medium sx*`&optional`

sy origin)`&body`

body

- Summary:
- Establishes a scaling transformation on the medium
*medium*that scales by*sx*in the*x*direction and*sy*in the*y*direction, and then executes*body*with that transformation in effect. If*sy*is not supplied, it defaults to*sx*. If*origin*is supplied, the scaling is about that point; if it is not supplied, it defaults to (0, 0). *sx*and*sy*are as for**make-scaling-transformation**.- The
*medium*argument is not evaluated, and must be a symbol that is bound to a sheet or medium. If*medium*is**t**,***standard-output***is used.*body*may have zero or more declarations as its first forms.

- Arguments:
*(medium angle*`&optional`

origin)`&body`

body

- Summary:
- Establishes a rotation on the medium
*medium*that rotates by*angle*, and then executes*body*with that transformation in effect. If*origin*is supplied, the rotation is about that point; if it is not supplied, it defaults to (0, 0). *angle*and*origin*are as for**make-rotation-transformation**.- The
*medium*argument is not evaluated, and must be a symbol that is bound to a sheet or medium. If*medium*is**t**,***standard-output***is used.*body*may have zero or more declarations as its first forms.

**with-local-coordinates ** [Macro]

- Arguments:
*(medium*`&optional`

x y)`&body`

body

- Summary:
- Binds the dynamic environment to establish a local coordinate system on the medium
*medium*with the origin of the new coordinate system at the position*(x, y)*. The "directionality" of the coordinate system is otherwise unchanged.*x*and*y*are real numbers, and both default to 0. - The
*medium*argument is not evaluated, and must be a symbol that is bound to a sheet or medium. If*medium*is**t**,***standard-output***is used.*body*may have zero or more declarations as its first forms.

- Arguments:
*(medium*`&optional`

x y)`&body`

body

- Summary:
- Binds the dynamic environment to establish a local coordinate system on the medium
*medium*with the positive*x*axis extending to the right and the positive*y*axis extending upward, with the origin of the new coordinate system at the position*(x, y)*.*x*and*y*are real numbers, and both default to 0. - The
*medium*argument is not evaluated, and must be a symbol that is bound to a sheet or medium. If*medium*is**t**,***standard-output***is used.*body*may have zero or more declarations as its first forms.

CLIM 2.0 User's Guide - OCT 1998

Generated with Harlequin WebMaker