Yes they are general. You can use them for either the CTM (current transformation matrix) or with an arbitrary matrix: concatmatrix does a matrix multiply with two given matrices, pretty much all the other matrix operators take an optional matrix as final argument, using CTM otherwise. And yes, the matrices are actually 6 element arrays, [a b c d e f], interpreted as 3x3 matrices representing 2D affine transformations in homogeneous coordinates [a b 0] [c d 0] [e f 1] with points x y being row vectors [x y 1] so x y [a b c d e f] transform -> ax+cy+e bx+dy+f --ms On 08-Nov-18 11:26, Henry Baker wrote:
Yes, it does have these operations, but they aren't "general", but have to do specifically with transforming the current coordinate system.
(Yes, one could save the coordinate system, utilize these operations, and then restore the coordinate system -- which might be a good way to implement a more general transform, but that more general transform isn't "built in", although it is also a one-liner.)
Notice also, that the 3x3 matrix ops in Postscript aren't general matrix ops, but are to implement *homogeneous* representations:
the triple (x,y,z) represents the 2D point (x/z,y/z).
So Cris also needs to teach his daughter homogeneous representations!
BTW, lots of kids in the early 1980's were already hacking Apple ]['s and assembly language, so 8th grade is NOT too early to start learning computer graphics.
At 08:01 AM 11/8/2018, Mike Speciner wrote:
PostScript has matrix operations, including concat (multiply) for 2D affine transformations.