position-transform

Function

Package: common-graphics

Arguments: position matrix

Transforms the given position with the supplied matrix, which is a 2 by 2 array (or larger 2-dimensional array -- extra cells of the array are ignored). Even if the elements of matrix are floats, the returned position will have rounded whole number components. The transform works as follows:

xnew = A(0,0)*xold + A(0,1)*yold
ynew = A(1,0)*xold + A(1,1)*yold

For example:

 (setq ar (make-array '(2 2) 
            :initial-contents '((5.0 2.0) (3.0 1.0))))
 (setq p1 (make-position 7 10)
 (position-transform p1 ar)
returns
#.(make-position 55 31) ; = 5*7 + 2*10, 3*7 + 1*10

Common Graphics and IDE documentation is described in About Common Graphics and IDE documentation in cgide.htm.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.