[Math] How to get coordinates of a point after an image is rotated? (with images)

analytic geometrycoordinate systemsgeometryrotations

I have a problem that involves a rotating image and finding a previously known point.

Firstly, there is a sequence with the rotation.

enter image description here

  1. We start with an empty image.

  2. A line is drawn vertically, from (0, 0) to a point in the y-axis (assume 50, possible values range from 0 to 100 which is the max). We will call this point 'a'.

  3. The image is rotated by 'x' degrees (known value).

  4. Another line is drawn vertically, from (0, 0) to a point in the y-axis (assume 60). We will call this point 'b'.


My question is, how do I get the coordinates of point 'a' relative to point (0, 0)?


Thank you all so much and I really appreciate your replies, good or bad. Please do tell me if you need more info on this.

Best Answer

Rotating a point $(0,A_y)$ on a plane about the origin by $x$ degrees (counter-clockwise) is given by $$ \left[ \begin{array}{c} A_x' \\ A_y' \\ \end{array} \right] = \left[ \begin{array}{cc} \cos x & -\sin x \\ \sin x & \cos x \\ \end{array} \right] \left[ \begin{array}{c} 0 \\ A_y \\ \end{array} \right], $$ where $(A_x',A_y') = (-A_y \sin x, A_y \cos x)$ denotes your new position. Relative to point $B$, the coordinates are: $$(-A_y \sin x, A_y \cos x - B_y)$$