0
926views
Derive the matrix in 2D for Reflection of an object about a line y=mx+c.
1 Answer
0
20views

Equation of Line: $y=m x+c$

slope $=m \quad$ y intercept $=c$

we can relate slope m to angle $\theta$ by equation

$m=\tan \theta$

$\therefore \theta=\tan ^{-1} m$

where $\theta$ is in inclination of line with respect to x -axis.

Translation matrix can be given as

$\mathrm{T}=\left[\begin{array}{ccc}{1} & {0} & {0} \\ {0} & {1} & {0} \\ {0} & {-c} & {1}\end{array}\right]$

Rotation matrix to match the given line with x -axis can be obtained as

$R_{z}=\left[\begin{array}{ccc}{\cos \theta} & {-\sin \theta} & {0} \\ {\sin \theta} & {\cos \theta} & {0} \\ {0} & {0} & {1}\end{array}\right]$

Reflection matrix about x -axis

$M=\left[\begin{array}{ccc}{1} & {0} & {0} \\ {0} & {-1} & {0} \\ {0} & {0} & {1}\end{array}\right]$

Inverse transformation matrices,

$R_{z}^{-1}=\left[\begin{array}{ccc}{\cos \theta} & {\sin \theta} & {0} \\ {-\sin \theta} & {\cos \theta} & {0} \\ {0} & {0} & {1}\end{array}\right] T^{-1}=\left[\begin{array}{ccc}{1} & {0} & {0} \\ {0} & {1} & {-c} \\ {0} & {0} & {1}\end{array}\right]$ $\therefore$

Final transformation matrix can be obtained as,

$R_{T}=T \cdot R_{z} \cdot M \cdot R_{z}^{-1} \cdot T^{-1}$

As we have $\tan \theta=\mathrm{m},$ using trigonometric identities we can obtain,

$\sin \theta=\frac{m}{\sqrt{m^{3}+1}} \quad \cos \theta=\frac{m}{\sqrt{m^{3}+1}}$

$\therefore R_{T}=\left[\begin{array}{ccc}{\cos 2 \theta} & {\sin 2 \theta} & {0} \\ {\sin 2 \theta} & {-\cos 2 \theta} & {0} \\ {-\operatorname{csin} 2 \theta} & {c(1+\cos 2 \theta)} & {1}\end{array}\right]$

By Substituting values of $\sin \theta$ and $\cos \theta$ we have

$R_{T}=\left[\begin{array}{ccc}{\frac{1-m^{2}}{m^{2}+1}} & {\frac{2 m}{m^{2}+1}} & {0} \\ {\frac{2 m}{m^{2}+1}} & {\frac{m^{2}-1}{m^{2}+1}} & {0} \\ {\frac{-2 m}{m^{2}+1}} & {\frac{2 c}{m^{2}+1}} & {1}\end{array}\right]$

Please log in to add an answer.