1

Imagine you have a robot whose position is recorded as $t_1, t_2, t_3, \dots$ in its coordinate frame. Check the visualization here.

We can write down the robot's basis in our 2D image plane, i.e. the standard $R^2$ basis, as:

$$ B=\begin{bmatrix} 3 & 1 \\ 1 & 1 \\ \end{bmatrix} $$

Clearly, this transformation takes any vector from the robot's world to the image plane. For example, the robot's position at time $t_3 = \begin{bmatrix} 3, &3 \end{bmatrix}^T$ is:

$$ B \cdot t_3=\begin{bmatrix} 3 & 1 \\ 1 & 1 \\ \end{bmatrix} \cdot \begin{bmatrix} 3 \\ 3 \end{bmatrix} = \begin{bmatrix} 12 \\ 6 \\ \end{bmatrix} $$

Now, if we would want to transform the robot's trajectory by rotating it by 45 degrees, we could compose the needed rotation by using the next matrices:

  • $B$, to get into the image frame;
  • $R_{45} = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & -1 \\ 1 & 1 \\ \end{bmatrix}$, the rotation matrix in the standard $R^2$ basis, which is our image frame;
  • $B^{-1}$, to get back to the robot's world.

When multiplied in the following order, $B^{-1}R_{45}B$, we get our rotation matrix for the robot's frame, $R'_{45}$:

$$ R'_{45} = B^{-1}R_{45}B =\frac{1}{\sqrt{2}} \begin{bmatrix} -1 & -1 \\ 5 & 3 \\ \end{bmatrix} $$

Now, we are able to recompute the route by applying $R'_{45}$ directly on $t_i$'s:

$$ R'_{45} \cdot t_3 =\frac{1}{\sqrt{2}} \begin{bmatrix} -1 & -1 \\ 5 & 3 \\ \end{bmatrix} \begin{bmatrix} 3 \\ 3 \end{bmatrix} = \sqrt{2} \begin{bmatrix} -3 \\ 12 \end{bmatrix} $$

The question is can we avoid computing $B^{-1}$ by utilizing the Gram-Schmidt process to compute the orthonormal basis? GS applied to $B$ gives us:

$$ B_{GS} = \frac{1}{\sqrt{10}} \begin{bmatrix} 3 & -1 \\ 1 & 3 \end{bmatrix} ,$$

and I know that $B_{GS}^{-1}$ in this case is just $B_{GS}^T$, which is super useful! However, I'm not sure how to use this freshly constructed basis to compute $R_{45}$ analog in the robot's world, and then apply it to the stored trajectory points.

dimart.sp
  • 113

1 Answers1

0

After orthogonalizing $B$, you’re in some other reference frame that happens to share one of its directions with the robot’s “$x$” direction (relative to the image frame). You’re still stuck with converting this intermediate frame from and to the robot’s native frame, so you’re only adding work this way.

Moreover, $B_{GS}$ is an orthogonal matrix, which represents either a rotation or reflection, depending on the sign of its determinant. In the former case, conjugating another rotation by $B_{GS}$ is a no-op, while in the latter, you end up with a rotation by the same angle but in the opposite direction.

In any case, why would you want to use G-S instead computing the inverse of a $2\times2$ matrix here? The latter is certainly more efficient: It only requires two sign changes and four divisions by the determinant, which is two multiplications and an addition, and you can hold off dividing by the determinant until you’ve done all of the other matrix multiplications in the conjugation. On the other hand, G-S will require computing, besides the dot product and vector addition in the second iteration, two normalization, each of which is one addition, four multiplications/divisions and a square root. Just the one normalization operation is already less efficient than the entire inversion.

amd
  • 55,082
  • Thank you! However, what is the point of G-S then? Could you modify the example so that it would make sense to use G-S?

    Of course, inverting a $2 \times 2$ matrix is easy but I was just trying to come up with a simple example to show the benefits of using G-S. I was trying to do things analogously to the lecturer here: https://www.coursera.org/learn/linear-algebra-machine-learning/lecture/oXE0Y/example-reflecting-in-a-plane

    – dimart.sp Apr 17 '19 at 10:37
  • @dimart.sp See https://math.stackexchange.com/q/1961727/265466 for a discussion of why G-S is important. Orthogonal and orthonormal bases have many useful properties, the most important of which, I think, is that a vector’s coordinates are simply its inner products with the basis vectors. However, in your example, you have to use a specific coordinate system for the robot, so orthogonalizing it doesn’t really make anything simpler there. – amd Apr 18 '19 at 17:51