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

--

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

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