Home > database >  Invert vector position transformation
Invert vector position transformation

Time:12-15

Help me please to solve this problem: I have a vector A and I get vector B this way:

B = M1 * A * 0.5   M2 * A * 0.5;

M1 - rotation matrix 0 deg.

M2 - rotation Matrix 45 deg.

I need to get a way to compute A if B is known. For instance if B == (0.8535, 0.3535), then A should be (1.0, 0.0). How can I get the inverted formula?

UPD: for 0.4/0.6 the result formula is:

A=(M1*0.4 M2*0.6)^-1 * B

CodePudding user response:

A = (M1 * 0.5 M2 * 0.5)^-1 * B

CodePudding user response:

Bring this equation into a single matrix-vector product

B = M1 * A * 0.5   M2 * A * 0.5
B = (M1 * 0.5   M2 * 0.5)*A
B = M*A

and invert M

A = inv(M)*B = M\B

For example

M1 = | 1   0 |          M2 = | 1/√2  -1/√2 |
     | 0   1 |               | 1/√2   1/√2 |

makes

M = | √2/4 1/2      -√2/4 |
    | √2/4       √2/4 1/2 |

and the inverse

inv(M) = | 1      √2-1 |
         | 1-√2      1 |

you will find that

 inv(M)*| 0.8535 | = |  0.999999  |
        | 0.3535 |   |  -3e-5     |

The above process is part of linear algebra, exactly because you can use the associative & distributive properties with non-scalar quantities.

  • Related