2
$\begingroup$

$T_1$ and $T_2$ are $3 \times 3$ homogenous transform matrices. $P_1$ is the $3 \times 1$ matrix with $x, y$ coordinates of point $P_1$.

What I am trying to do here is trying to get $x, y$ coordinate of point $P$ in coordinate system with transform $T_2$ when I know its $x, y$ in coordinate system with transform $T_1$.

Well in this relation it seems obvious that $P_2=T_2^{-1} \cdot T_1 \cdot P_1$. But this is giving wrong result in a code of mine. I am right now at my wit's end, so posted this question.

Are there any corner cases where this equation can fail? I know of one case when $\det(T_2)=0$.

  • 0
    What exactly are the $T_i$ and the $P_i$ that are giving you trouble? What results are you getting, and what results do you think you should see?2011-08-29
  • 0
    same question as above. Are the matrices represented in a symbolic way or numerical?2011-08-29
  • 0
    @J.M. For any values of $T_i$ and $P_i$ it gives me trouble. The value of $P_2$ I get is quite far off. I am not sure what's going on but I rechecked the program a number of times and the logic seems to be fine. From your response it seems there aren't any more corner cases. Then I guess I need to revisit my code again.2011-08-29
  • 0
    @newbie I really didn't get your question.2011-08-29
  • 0
    "any"? Something indeed is off. You keep saying "far off"but you didn't say exactly what you're seeing and what you think you should be seeing...2011-08-29
  • 0
    as you mentioned codes a several times, i think those matrices are given in a numerical way. if you could explain in more details about your program, it may help us to understand. what are the transform matrices' role: transform(from one point to the other), rotation, or reflection(flip)? How do you describe them, e.g. $\begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix} $?2011-08-29
  • 0
    @newbie It is like your example except that it has one more column and row. As shown at [wikipedia](http://en.wikipedia.org/wiki/Transformation_matrix#Affine_transformations).2011-08-30
  • 0
    So, could you give it explicitly? Because if it is a rotation matrix, the determinant would never be 0. Or, I advice you to go through your codes carefully once more: pay extra attention to details, brackets, parenthesis, etc, and also if/while/for loops if applicable. If the matrixe setting is right, there must be somethings wrong in the code implementation.2011-08-30
  • 0
    Or, to simplify the problem, insteading transforming twice(one forward one backward), try to use ONE transform matrix: if $T_{1}$ is composed by angle $\alpha$ and $T_{2}$ by $\gamma$, then use $T$ composed by angle $\alpha - \gamma$. It allows you to avoid the computation of inverse matrix and matrix operation.2011-08-30

1 Answers 1