• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Help with understanding matrices
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with understanding matrices


  • Subject: Re: Help with understanding matrices
  • From: deivy petrescu <email@hidden>
  • Date: Tue, 12 Feb 2008 22:04:51 -0500

Simon;

On Feb 12, 2008, at 13:41, 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.

I tried to read the wikipedia entry but it was way over my head!

http://en.wikipedia.org/wiki/Matrix_(mathematics)

What I'm trying to work out is the rotation and/or scale of an image placed in Adobe Illustrator CS3.

Getting to matrix of an image when first placed into returns the result:

{class:matrix, mvalue_a:1.0, mvalue_b:0.0, mvalue_c:0.0, mvalue_d:-1.0, mvalue_tx:-7598.0, mvalue_ty:9058.275390625}

As Doug pointed out earlier, this is a matrix that tells us that the x- axis is the usual x-axis, but the y-axis is reflected. That is y -> -y.
I assume tx and ty are related to the size of the image, but I am not sure (read below why).


If I rotate the image by 45 degrees clockwise, the matrix is now:

{class:matrix, mvalue_a:0.707106769085, mvalue_b:-0.707106769085, mvalue_c:-0.707106769085, mvalue_d:-0.707106769085, mvalue_tx:-1.14441533203125E+4, mvalue_ty:821.1611328125}

This matrix indeed corresponds to a rotation of 45 degrees clockwise for a system of coordinates (x,-y). I have no clue as why tx and ty are changed.


And, if I then scale it by 50%, the matrix is now:

{class:matrix, mvalue_a:0.353553384542, mvalue_b:-0.353553384542, mvalue_c:-0.353553384542, mvalue_d:-0.353553384542, mvalue_tx:-5511.07666015625, mvalue_ty:559.08056640625}

This is absolutely bogus. Scaling is a conformal map, that is, it preserve angles. So this matrix does not represent a rotation, however, tx and ty are scaled by 1/2 and therefore suggest size. But no guarantees.
Unless there is an algorithm, probably based on the tangent of the angle, this matrix above is pure garbage.


To see if you can get anything out of this, rotate 30 and 60 degrees, scale and also scale without any rotation.
Send the matrices.
However, this weekend does not seem very promising, if you have some time to wait...


So, how would I work out what the rotation and scale of the image is given the values in the second and third results?

What do the "mvalue" numbers define? Is there even a way to get the rotation and scale from these numbers?

TIA for anyone willing to help me with this.

Simon


Deivy
_______________________________________________
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
  • Follow-Ups:
    • Re: Help with understanding matrices
      • From: Doug McNutt <email@hidden>
References: 
 >Help with understanding matrices (From: Simon Topliss <email@hidden>)

  • Prev by Date: Re: Help with understanding matrices
  • Next by Date: Re: Help with understanding matrices
  • Previous by thread: Re: Help with understanding matrices
  • Next by thread: Re: Help with understanding matrices
  • Index(es):
    • Date
    • Thread