[Math] Rotate a line by a given angle about a point

geometry

Given the coefficients of a line $A$ , $B$ and $C$.

$$ Ax + By + C = 0$$
I wish to rotate the line by angle say $\theta$ about a point $x_0$ and $y_0$ in clockwise direction. How can I achieve this so that I get new coefficients then?

Best Answer

Take a point on this line, say $$A=\binom{x}{\frac{-C-Ax}{B}}$$ multiply the coordinates of this point by the rotation-matrix defined by $$R_\theta=\bigg(\matrix{\cos\theta &&-\sin \theta \\\sin\theta && \cos\theta}\bigg)$$ Immediately you get $$A^\prime=\binom{x\cos\theta+\frac{C+Ax}{B}\sin\theta}{x\sin\theta-\frac{C+Ax}{B}\cos\theta}$$ which defines the equation of the rotated line (extract $y$ from it and proceed).

EDIT: Notice that $$A_x=x(\cos\theta+\frac A B \sin\theta)+\frac{C}{B}\sin\theta\Rightarrow x=\frac{A_x-\frac{C}{B}\sin\theta}{\cos\theta+\frac{A}{B}\sin\theta} \\ A_y=x(\sin\theta-\frac A B\cos\theta)-\frac C B\cos\theta \\ A_y=\frac{(A_x-\frac{C}{B}\sin\theta)(\sin\theta-\frac A B \cos\theta)}{\cos\theta+\frac{A}{B}\sin\theta}-\frac{C}{B}\cos\theta$$and from here I guess you can get $A_y$ in terms of $A_x$ and generalize to get the rotated plan equation.

Related Question