CHAPTER 8
Non-linear 2D transformations:
deconstructing paths
Sometimes we want to draw a figure after a non-linear transformation has been applied to it. In image manipula-
tion programs, this is often called morphing. For example, here is a morphed 10 ×10 grid produced by a program
in which the basic drawing commands drew a square grid and these were followed by some transforming code
before stroking.
In order to apply transformations to paths, we just have to understand (a) transformations and (b) paths!
8.1. Two dimensional transformations
A 2D transformation is a function f(x, y) of two variables which returns a pair of numbers u(x, y) and v(x, y),
the coordinates of the transform of the point (x, y). We have already seen affine transformations where
f(x, y) = (ax + by + c, dx + ey + f)
for suitable constants a, b, etc. But now we want to allow more complicated ones. I should say right at the
beginning that these can be very complicated. An affine transformation is not so difficult to visualize because we
know what the transformation does everywhere if we know what it does to just a single square. But an arbitrary
transformation may have very different effects in different parts of the plane, and this is the source of much
difficulty in comprehending it. Indeed, the nature of 2D transformations has been in not-so-distant times the
subject of interesting mathematical research. (I am referring to the stability of properties of such transformations
under perturbation, part of the so-called ‘catastrophe theory’.)
I’ll spend some time looking at one which is not too complicated:
f(x, y) = (x
2
− y
2
, 2xy) .
This is not quite a random choice—it is derived from the function of complex numbers that takes z to z
2
, since
(x + iy)
2
= (x
2
− y
2
) + i (2xy) .