Questions on linear transformation lab


initially have one set of questions but will likely have more later, does the 0 in the middle on transformed vector mean it’s now a three dimensional vector, if not what does it mean and how do I read it, also where are the 0,0 2,0 etc in the original code coming from?

Well, it’s not the 0 specifically in position [1,0] of the vector. It’s that there are three elements in the output vector that makes it an element of \mathbb{R}^3.

The [0,0] and [2,0] are the indices of the elements of the output w vector that are being set by the T function. The convention being used here is that the vectors are formatted as “column vectors” with a first dimension of either 2 or 3 in this case and a second dimension of 1.

1 Like

but we wouldnt know the 0,0 etc from the above equation right? also still not following for other part? the numbers represent how far it moves along each axis so the fact theres three number must mean it’s not just moving on x and y axis right?

The thing to remember is that the [0,0] has nothing to do with coordinates on the x - y axes. It’s only about the indices of the vectors, which are represented in numpy as either 2 x 1 numpy arrays (for the input) or 3 x 1 numpy arrays for the output.

So w[0,0] is the first element of the output vector, which is being set to 3 * the value of the first element of the input vector.

but where are the 2,0 and the 1,0 in the second one coming from then

They are the index values for the 3rd and 2nd elements of the output vector respectively. It’s a 3 element vector, so here is a list of the elements in the vector in order:

w[0,0], w[1,0], w[2,0]

So those “coordinates” have nothing do with Euclidean space or x - y coordinates.

If you mean this equation:

w[2,0] = -2 * v[1,0]

That is saying that the third element of the output w vector is equal to -2 * the second element of the first input vector v

It’s a really confusing example. I dislike it so much.

What this “transformation” is doing is scaling the two features v1 and v2, and adding a new row of 0 in the middle.

It’s sort of a useless skill to learn.

And the notation is confusing, because it uses two index values where only one is needed.

Here is a drawing version of Paul’s and Tom’s answers: