Re: Help with understanding matrices
Re: Help with understanding matrices
- Subject: Re: Help with understanding matrices
- From: Doug McNutt <email@hidden>
- Date: Tue, 12 Feb 2008 12:46:24 -0700
At 18:41 +0000 2/12/08, Simon Topliss wrote:
>Hello everyone. Is there a maths genius in the room?
>
>I never studied matrices at school and I'm having a great deal of difficulty understanding how to do matrix calculations.
and some more.
First: What you might have learned in school about matrix transformations would have been useless. Adobe's idea of matrix multiplication and other operations does not match the textbooks.
A 2 dimensional rotation is a 2 x 2 matrix multiplication in "maths" but a 3 x 3 operation with one column always (0,0,1) in Adobe's graphics. That's a bit like homogeneous equations in the mathematics of projective geometry but not quite. The a, b, c, d, tx, and ty values are the 6 values that are not the left column of the 3 x 3 matrix. The upper left 2x2 square:
a = cos phi b = sin phi
c = -sin phi d = cos phi
Is pretty much a real mathematical rotation but you'll be bothered because it's not centered on the object and the angles are not measured the way mathematicians think about it
The bottom row represents translation by tx and ty with a 1 at the right end
tx ty 1
Two zeros complete the matrix in the upper two thirds of the right column.
Scaling is accomplished as a rotation of zero degrees with the trig functions multiplied by the scale factor. The cosines of a zero degree rotation are 1 and the sines are zero.
Adobe's "Postscript Language Reference Manual - the red book - by Addison Wesley ISBN 0-201-18127-4 is the bible and you will need it. Page 155 in the 2nd edition.
Postscript also does things differently than does open GL which uses 4 x 4 matrices to describe 3 D images in a manner that more closely resembles projective geometry.
And matrix multiplication begins with dot products. Each element of the result is the dot product of a row vector from the left matrix and a column vector from the right. The result is not commutative so A * B is not necessarily the same as B * A. The dot product is the some of the products of the components of two vectors.
AppleScript is not the right tool for extensive matrix manipulations.
--
--> From the U S of A, the only socialist country that refuses to admit it. <--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden