Hi All,
I'm struggling to understand how the equations below are arrived at
for a rotation around the Zaxis:
x' = x cos theta  y sin theta
y' = etc...
This is how I understand it...
I have a point P in a 2D cartesian space that I want to rotate around
the origin to P'.
I know the values of P(x,y) and the angle of rotation (theta) and I
want to find the x,y coordinates of the new point P'.
Y

 *P'
 *P


_______X
The x and y components of P form a triangle as do those of P'
P
/
/ 
/  Height = Py
/ 
/ 
/_____
Base = Px
The hypotenuse (r) of the 'P triangle' above formed by the point P and
the origin is :
r = (Px^2 + Py^2)^0.5
So I now have the length of r which is the hypotenuse of my P and P'
triangles
Finding P'x
=============================
To find P'x i need one extra piece of information, either the length
of another side or an angle.
Using an angle  i need the angle between the xaxis and P'r (the
hypotenuse of P'):
to do this i need to:
1) Calculate the angle formed by my P triangle between the xaxis and
P r (the hypotenuse of P)  lets call this angle A
2) Add this angle to the known angle of rotation (A')
1  I can calculate the angle A by doing the following:
tan(A) = Py/Px
so A = arctan(Py/Px)
2  If i then add angle A to the angle of rotation (A') i get the
angle formed by my P' triangle between the xaxis and the hypotenuse
of P' which we will call angle A + A' so i can think about calculating
P'x as follows...
P'x = P'r * Cos(A + A')
Finally P'Y can be calculated using pythagoras's theorem or using sin
as follows
P'Y = P'r * sin(A + A')
so my question is how do I get from
x' = P'r * cos(A + A')
y' = P'r * sin(A + A')
to
x' = x cos(theta)  y sin theta etc...
Thanks (very) musch in advance,
Ben.