AffineTransform rotation question

Discussion in 'Java' started by hilz, Dec 16, 2004.

  1. hilz

    hilz Guest

    Hi all:
    I have an AffineTransform that has a uniform scale(x scale == y scale). How
    can i get the rotation portion of it, or the rotation angle "theta" ?

    One suggestion was to scale it by the square root of the determinant of the
    matrix, and set the translate portion to 0,0 but that does not seem to give
    correct values.
    Can anyone please tell me what do i need to do to get the theta ?
    thanks
    hilz
     
    hilz, Dec 16, 2004
    #1
    1. Advertising

  2. hilz wrote:
    > I have an AffineTransform that has a uniform scale(x scale == y scale). How
    > can i get the rotation portion of it, or the rotation angle "theta" ?


    Just apply the transformation to two simple points P0(0,0), P1(1,0). The
    resulting P0' and P1' will allow you to determine everything you want to
    know with elementary math.

    /Thomas

    --
    ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
     
    Thomas Weidenfeller, Dec 17, 2004
    #2
    1. Advertising

  3. hilz

    hilz Guest

    "Thomas Weidenfeller" <> wrote in message
    news:cpu8em$och$...
    > hilz wrote:
    > > I have an AffineTransform that has a uniform scale(x scale == y scale).

    How
    > > can i get the rotation portion of it, or the rotation angle "theta" ?

    >
    > Just apply the transformation to two simple points P0(0,0), P1(1,0). The
    > resulting P0' and P1' will allow you to determine everything you want to
    > know with elementary math.
    >
    > /Thomas
    >
    > --
    > ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq


    Thank you Thomas.
    That was simple yet effective!
    I am new to this area and i am experimenting with it.Your suggestion opened
    my eyes to a lot of things!
    thank you.
    hilz
     
    hilz, Dec 17, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rick
    Replies:
    2
    Views:
    757
    Thomas Weidenfeller
    Oct 8, 2003
  2. SPG
    Replies:
    0
    Views:
    369
  3. news.skynet.be
    Replies:
    0
    Views:
    584
    news.skynet.be
    Mar 25, 2005
  4. fiziwig
    Replies:
    10
    Views:
    2,365
    Thomas Weidenfeller
    Aug 14, 2006
  5. Thijs Muizelaar

    AffineTransform

    Thijs Muizelaar, Jan 11, 2008, in forum: Java
    Replies:
    4
    Views:
    409
    Wayne
    Jan 11, 2008
Loading...

Share This Page