How do I rotate a line segment in a specific point on the line?

3k Views Asked by At

If I have two points $A$ and $B$, which $AB$ is a line segment, how can I rotate the $AB$ in another Point $C$ which is a point on the line $AB$.

Thank you in advance.

2

There are 2 best solutions below

0
On

Lets just say you have a point $A=(1, 1)$ and $B=(1, 3)$. Suppose you want to rotate $\overline{AB}$ about the point $C=(1, 2)$ by $\theta = \frac{\pi}{2}$ counter-clockwise, which will give you a segment from $(0, 2)$ to $(2, 2)$.

Step 1. You need to translate $C$ to the origin, i.e. apply the linear map $Ax = x-C$.

Step 2. Rotate the segment by using the rotational matrix \begin{align} R(\theta) = \begin{pmatrix} \cos\theta & -\sin \theta\\ \sin\theta & \cos\theta \end{pmatrix}. \end{align}

Step 3. Translate back, i.e. $A^{-1}x= x+C$.

Thus, the entire process becomes $A^{-1}R(\theta)A$, a conjugation. Any how, lets see this in our example.

Take the point $(1, 1)$ which gets map to $(1,1)-(1, 2) = (0, -1)$. Then the rotation by $R(\pi/2)$ gives \begin{align} \begin{pmatrix} 0 & -1\\ 1 & 0 \end{pmatrix} \begin{pmatrix} 0\\ -1 \end{pmatrix} = \begin{pmatrix} 1\\ 0 \end{pmatrix}. \end{align} Lastly, translate back gives $(1, 0) +(1, 2) = (2, 2)$.

2
On

Using complex numbers:

In the complex, multiplying by $e^{i\theta}$ amounts to a rotation around the origin by the angle $\theta$. To rotate around another point, translate so that the center moves to the origin, rotate and translate back.

Hence, for any point $a$ in the plane

$$a'=(a-c)e^{i\theta}+c.$$

This expands as

$$a'_x=(a_x-c_x)\cos\theta-(a_y-c_y)\sin\theta+c_x,\\ a'_y=(a_x-c_x)\sin\theta+(a_y-c_y)\cos\theta+c_y. $$