• 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: "Mark J. Reed" <email@hidden>
  • Date: Wed, 13 Feb 2008 10:58:22 -0500

On Feb 13, 2008 5:46 AM, Simon Topliss <email@hidden> wrote:
> {class:matrix, mvalue_a:0.25, mvalue_b:-0.43301269412,
> mvalue_c:-0.43301269412, mvalue_d:-0.25, mvalue_tx:-5584.02001953125,
> mvalue_ty:-883.80078125}

> I'm trying to write a AppleScript handler that will return rotation,
> scale, skew of an object given its matrix.
>
> Can anyone help me get close to achieving this?

Yes...  I gave you the formula in my last message.  Try this:

on decode_matrix(mat)
    set a to mvalue_a of mat
    set b to mvalue_b of mat
    set c to mvalue_c of mat
    set d to mvalue_d of mat
    set theta to atan2(c, d);
    set cos_theta to cos(theta);
    set hscale to a / cos_theta
    set vscale to d / cos_theta
    set theta_deg to theta / pi * 180
    return {theta_deg, hscale, vscale}
end decode_matrix


>
> Simon
>
>
>  _______________________________________________
> 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
>



--
Mark J. Reed <email@hidden>
 _______________________________________________
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: Simon Topliss <email@hidden>
References: 
 >Help with understanding matrices (From: Simon Topliss <email@hidden>)
 >Re: Help with understanding matrices (From: Simon Topliss <email@hidden>)

  • Prev by Date: Re: terminology conflicts, etc. [was: Re: A date IS a date]
  • Next by Date: Re: terminology conflicts, etc. [was: Re: A date IS a date]
  • Previous by thread: Re: Help with understanding matrices
  • Next by thread: Re: Help with understanding matrices
  • Index(es):
    • Date
    • Thread