I was playing around with some of the Image processing commands like ImageRotate.
I thought it would be fun to try and make up some basic linear transformation rules - starting in 2D and then going to 3D.
I wrote up some naive rules as:
iden = {{1, 0}, {0, 1}}; (* identity, leave all points unmoved *)
axisres[a_, b_] := {{a, 0}, {0, b}} (* axis rescaling *)
rot[th_] := {{Cos[th],-Sin[th]},{Sin[th],Cos[th]}} (* rotation *)
reflect = {{-1, 0}, {0, 1}}; (* reflection *)
shearleft[a_] := {{1, a}, {0, 1}} (* shear left direction *)
shearright[b_] := {{1, 0}, {b, 1}} (* shear right direction *)
However, when I do the following - only the identity works properly.
image1 = {{0.1, 0.2}, {0.4, 0.5}};
Image[image1]
Image[image1.iden]
Image[image1.axisres[1,2]]
Image[image1.rot[Pi]]
Image[image1.reflect]
Image[image1.shearleft[.2]]
Image[image1.shearright[-.2]]
I suspect it is some silly error, but I still do not see it. Why do these simple transformations not preserve the image and just perform their intended operation?