givens rotation from right side

:)

I have this matrix:

B = \begin{bmatrix} 0.626 & 2.56 & 2.15 & \\ 0.835 & 6.66 & 5.16 & \\ 0 & 0 & -1.65 & \end{bmatrix}

I was wondering how to find a givens matrix such that I could apply it from the right side of the matrix and eliminate B[2][1] (0.835).

B*g = \begin{bmatrix} * & * & * & \\ 0 & * & * & \\ 0 & 0 & * & \end{bmatrix} Best regards, rox


Solution 1:

See https://stackoverflow.com/a/4361442/380384

    | a  b  tx |
A = | c  d  ty |
    | 0  0  1  |

which transforms the coordinates [x,y,1] into:

[x',y',1] = A * [x,y,1]

Thus set the traslation into [dx,dy]=[tx,ty]

The scale is sx=sqrt(a^2+b^2) and sy=sqrt(c^2+d^2)

The rotation angle is t=atan(c/d) or t=atan(-b/a) as also they should be the same.

The inverse matrix is $$ A^{-1} = \frac{1}{a d-b c} \begin{bmatrix} d & -b & b t_y-d t_x \\ -c & a & c t_x-a t_y \\ 0 & 0 & a d - b c \end{bmatrix} $$

Or you can try

$$ \begin{bmatrix} a & b & t_x \\ c & d & t_y \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 \\ -\frac{c}{d} & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} = \begin{bmatrix} a-\frac{b c}{d} & b & t_x \\ 0 & d & t_y \\ 0 & 0 & 1 \end{bmatrix} $$