I am programming in Processing and I need a bit of help in mathematics. What I have is a standard axis system with the axes x and y, but tilted by r degrees. If I draw a point at (100, 100), it will draw it according to the altered axes, meaning it won't be at (100, 100) in the upright system.
Now, if I want to pick any point the normal system, I want to calculate the coordinates of the point in the altered system, so that I can easily fill those in and it will be in the place my upright-mind wants them to be.
I know the calculations for it aren't supposed to be difficult, but I just can't figure it out. How do I calculate x' and y'?
Thanks a lot!
If the rotation is counterclockwise by angle $\alpha$ and $(x,y)$ are the coordinates in the original axes and $(x', y')$ are the coordinates in the new (transformed) axes, then:
$x' = x \cos\alpha + y \sin\alpha$
$y' = y\cos\alpha - x\sin\alpha$