Velocity Reviews > Java > AffineTransform rotation question

AffineTransform rotation question

hilz
Guest
Posts: n/a

 12-16-2004
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

Thomas Weidenfeller
Guest
Posts: n/a

 12-17-2004
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/...g/java/gui/faq

hilz
Guest
Posts: n/a

 12-17-2004

"Thomas Weidenfeller" <(E-Mail Removed)> wrote in message
news:cpu8em\$och\$(E-Mail Removed)...
> 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/...g/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

 Thread Tools

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post fiziwig Java 10 08-14-2006 08:51 AM news.skynet.be Java 0 03-25-2005 12:00 PM SPG Java 0 03-04-2005 12:25 PM Louise Digital Photography 19 02-02-2004 08:37 AM Rick Java 2 10-08-2003 10:46 AM

Advertisments