How to multiply a vector and matrix when the matrix includes a translation?

40 Views Asked by At

What is the proper way to right multiply an $N$ x $N$ matrix $H$ by an $N$ x $1$ vector $\mathbf{v}$, if $H$ includes a translation vector?

For example, say

$$H=R-\mathbf{tn}^T$$

where $R$ is a conventional rotation matrix, $\mathbf{t}$ is a translation vector and $\mathbf{n}^T$ is the transpose of the normal vector to a plane. And I want to figure out $\mathbf{v'}$:

$$\mathbf{v'}=H\mathbf{v}$$

The rotation part of the equation is easy (say $N=2$ and $\mathbf{v}=(x,y)$):

$$R\mathbf{v}=\begin{bmatrix}x_r\\y_r\end{bmatrix} =\begin{bmatrix}\cos{\theta} & -\sin{\theta}\\\sin{\theta} & \cos{\theta}\end{bmatrix} \begin{bmatrix}x\\y\end{bmatrix}$$

$$\begin{matrix}x_r=x\cos{\theta}-y\sin{\theta} \\y_r=x\sin{\theta}+y\cos{\theta}\end{matrix}$$

But now I'm not sure what to do with the translation part.

$$\mathbf{tn}^T\mathbf{v}=?$$

Help is appreciated. The matrix $H$ in this question is based on the homography matrix.

1

There are 1 best solutions below

0
On BEST ANSWER

$$\mathbf{v'}=H\mathbf{v}=(R-\mathbf{tn}^T)\mathbf{v}=R\mathbf{v}-\mathbf{t}(\mathbf{n\cdot v})$$

where $\mathbf{n\cdot v}$ is a scalar.