Math/Theory Questions about PostScript-style drawing
Math/Theory Questions about PostScript-style drawing
- Subject: Math/Theory Questions about PostScript-style drawing
- From: Matthew Cox <email@hidden>
- Date: Mon, 17 Sep 2001 16:29:38 -0400
Anyone competent to respond to this message probably knows all this
intro, but I'm including it in case my comprehension is in someway
flawed.
I know that the 2D Transformation Matrix functions as, in poor notation:
[ a | b | u ]
[ c | d | v ]
[ tX| tY| w ]
And to calculate the position of a point (x', y') from an older point
(x, y):
x' = ax + cy + tX;
y' = bx + dy + tY;
And you create transformations based on the identity matrix:
[ 1 | 0 | 0 ]
[ 0 | 1 | 0 ]
[ 0 | 0 | 1 ]
And one can:
Translate:
[ 1 | 0 | 0 ]
[ 0 | 1 | 0 ]
[ bx|by | 1 ]
Scale:
[ Sx| 0 | 0 ]
[ 0 | Sy| 0 ]
[ 0 | 0 | 1 ]
And rotate:
[ cos(C) | sin(C) | 0 ]
[ -sin(C)| -cos(C)| 0 ]
[ 0 | 0 | 1 ]
So my question is: since these seem to operate on points individually,
how can multiplying a point by the scaling matrix enlarge it? It would
simply spit out a new point, and the same sort of idea for Rotation, is
it not just rotating a point, which is essentially a zero-dimensional
object? Or am I missing a portion of the step? For instance, wouldn't
the rotation matrix need to "know" what the center of rotation is? Or
would the scale need to know where to find the center of the construct,
so it could "stretch" points accordingly? I'm interested more in the
mathematics of it than the actual implementation and use, but still
real-world usage would be appreciated.