I want to add a new var called atom.transform (also to images; this will apply to all Appearances). This will be a matrix stored as a simple 6-element list, or null when using the default. Tom and I agreed this makes more sense than doing separate rotate/scale/etc., but we should have helper functions for it.
Originally I was thinking of doing something like this:
// create a rotation matrix
transform = matrix(45, MATRIX_ROTATE)
// scale the transform matrix by 2x2
transform = matrix(transform, 2, 2, MATRIX_SCALE)
This is a very Blend()-like syntax, but as Tom pointed out, while it's flexible it's not necessarily intuitive. I do want KISS here, so I'd preferably at least want a way to multiply matrices, rotate, scale, and possibly translate. (My original stable of choices included multiply, add, subtract, invert, rotate, scale, translate, and I was thinking interpolate might also be useful.) I suppose there's no reason the original format couldn't be used, with aliases referring to the common operations, but it'd be nice to get input on what people would find useful and how they'd like to work with it.
This is the way a matrix would lay out:
transform = list(a, b, c, d, e, f)
a b c x x'
d e f × y = y'
0 0 1 1 1
x' = ax + by + c
y' = dx + ey + f
A clockwise rotation by angle A, where s=sin(A) and c=cos(A), would be in the form list(c,s,0,-s,c,0). Obviously that's not something we want users to have to calculate, hence the need for helper functions.
I realize we already have pixel offsets for translation, but it seemed reasonable to include something in the matrix itself.
If we could get an actual /matrix type, then we could use the * operator, and have procs like matrix.Inverse(), matrix.Scale(2,2), matrix.Translate(), ect.
Also, what do you mean by an interpolate operator?