4

Determine the homogeneous transformation matrix for reflection about the line $y = mx + b$, or specifically $ y = 2x - 6$.

I use $mx - y +b =0$: $\text{slope} = m$, $\tan(\theta)= m$

intersection with the axes:

$x =0$ is $y = -b$ and $y =0$ is $x = \dfrac{b}{m}$

My question is, what can I do next?

belo gadelo
  • 311
  • 1
  • 4
  • 10

2 Answers2

1

Write down the transform in vector form and you can derive it from scratch. The line can be written as $mx-y=-b$. The normal to the line is $\vec{n}=(m,-1)$. Let's also introduce some initial point on the line -- let's say $\vec{r}_0=(x,y)=(0,b)$. How do you reflect about a line through the center? Easy - subtract twice the projection to the normal. How about if it's not through the center? Move to the center, transform, and move back. The transform is:

$$\vec{r} \mapsto (\vec{r}-\vec{r}_0)-2\hat{n}( \hat{n}\cdot(\vec{r}-\vec{r}_0))+\vec{r}_0$$ I normalized the normal, $\hat{n}=\frac{\vec{n}}{|n|}=\frac{(m,-1)}{\sqrt{m^2+1}}$.

This can be simplified to: $$\vec{r}-2\hat{n}( \hat{n}\cdot\vec{r})-2\hat{n}( \hat{n}\cdot\vec{r}_0)$$ The first two terms are the standard reflection matrix in 2D and represents the 2×2 block of your homogeneous 3×3 matrix. The last term is the offset that contributes to both components of the result, and is in the homogeneous coordinates obtained from the last column (which multiplies the constant third coordinate).

Observe that because $\vec{r}_0$ is on the line, it satisfies the original equation $\vec{n}\cdot\vec{r}_0=-b$, so our choice of the origin point is irrelevant.

Now, you can simply write the matrix out:

$$\begin{bmatrix}x'\\y'\\1\end{bmatrix}=\begin{bmatrix}1-2n_x^2/|n|^2 & -2n_xn_y/|n|^2 & 2n_xb/|n|^2 \\ -2n_xn_y/|n|^2 & 1-2n_y^2/|n|^2 & 2n_yb/|n|^2 \\0 & 0& 1\end{bmatrix}\begin{bmatrix}x\\y\\1\end{bmatrix}$$

In our specific case: $$\begin{bmatrix}1-2m^2/(m^2+1) & 2m/(m^2+1) & 2mb/(m^2+1) \\ 2m/(m^2+1) & 1-2/(m^2+1) & -2b/(m^2+1) \\0 & 0& 1\end{bmatrix}$$


You can see it's way easier, if you use the canonical implicit form for the line. If you have $$ax+by=c$$ where $a^2+b^2=1$, then the matrix simplifies to $$\begin{bmatrix}1-2a^2 & -2ab & -2ac \\ -2ab & 1-2b^2 & -2bc \\0 & 0& 1\end{bmatrix}$$ or, if you want, $I-2(a,b,0)^T(a,b,c)$.

orion
  • 15,781
-1

Note that any matrix $\mathbf A\cdot \vec{0}=\vec{0}$, so there is no matrix that can flip over $y=2x-6$ as it must map $\vec 0 \to (4 \frac{4}{5},-2\frac{2}{5})$. You might want to do something about that.

Tim Ratigan
  • 7,247
  • 1
    We're talking about homogeneous coordinates. All affine transforms can be written as homogeneous matrices. So we're working with vectors in the form (x,y,1). – orion Feb 19 '16 at 08:03