0
$\begingroup$

Lets suppose I have a straight line on Cartesian plane and I will rotate it on 35 deg, What will be the new coordinates on the end point of that line?

Here is a diagram to show what I mean:

enter image description here

I have spent a lot of time trying to find a formula for this! any help in the right direction would be much appreciated.

  • 0
    See whether this helps you: http://math.stackexchange.com/questions/404407/new-x-coordinate-of-a-rotated-line2017-01-24

1 Answers 1

1

For rotations around the origin, use a rotation matrix. In your case this matrix would be of the form:

$$A = \begin{bmatrix}\cos(35°) & -\sin(35°)\\\sin(35°) & \cos(35°)\end{bmatrix}$$

As you want to rotate $P := (100, 10)$ around $(10,10)$, you'll need to translate $P$ by $(-10,-10)$ first.

  • translate $P := (100, 10)$ to $(90, 0)$
  • rotation (i.e. multiplication with $A$) yields $(90 \cdot \cos(35°), 90 \cdot \sin(35°))$
  • translate back to $(90 \cdot \cos(35°) + 10, 90 \cdot \sin(35°) + 10)$, which is your result.

Using homogenous coordinates, you could also combine the steps above into a single matrix multiplication.

  • 0
    Thanks, I was working with coordinates 0,0 in actual context so I ended up with this simple function `(100⋅cos(35°), 100⋅sin(35°))` where `100` being the end point of line on x axis.2017-01-24