# Change basis effect

Use the mouse to move the dots to change the basis B, transformation T, and transformed point w. Note that changing B does not change where w is, but changes how it is written.
Note that the transformation T is determined by the images of the basis elements B.

v_{0}

v_{1}

T(v_{0})

T(v_{1})

w

T(w)

Basis B={v_{0},v_{1}}

wrt standard basis:

v_{0} = (1,0)

v_{1} = (0,1)

w wrt B:

w = (1,1)_{B}

linear transformation T

wrt
B:

${T}_{B}={\left[\begin{array}{cc}1& 0\\ 0& 1\end{array}\right]}_{B}$

1v_{0}

1v_{1}

1T(v_{0})

1T(v_{1})

1

0

0

1

1

0

0

1

initial graph

transformed graph

mouse:

Note on controls: click on a dot to toggle moving that dot.
Then mouse will move that dot, even if mouse is not down.
To release the dot, click again where you want it to be positioned. You
can't move another dot until you click the mouse to put the
moving dot down. You can move dots labled v_{0},
v_{1}, w,
T(v_{0}),
T(v_{1}). The position of T(w) is determined by the position of
w, and the map T. Changing v_{0} or
v_{1} does not change w, only how w is written in terms of them.

The point of this graphic is to illustrate writing linear transformations
with respect to different basis.

Our basis is the set B= {v_{0},
v_{1}}, given by the red and blue points. These can be moved to
define a different basis by using the mouse.

The green point is a point w in our space.

When the basis changes, how we write w in terms of
{v_{0},
v_{1}} changes, but w stays in the same place; changing basis doesn't change w, it just changes how w is written in terms of the basis.
w can be moved to a
different point with the mouse.

The transformation T can be described by a matrix. The matrix is written
in terms of the basis {v_{0},
v_{1}}. The images of these two vectors are
{u_{0},
u_{1}}, given by magenta and cyan dots. These are
{T(v_{0}),
T(v_{1})},
These points determine the transformation, and can be moved by the mouse
to determine a different transformation. The image of w
is T(w).

T is a linear map, which means that the relationship between
T(w) and {T(v_{0}),T(v_{1})} is the same as the
relationship between
w and {v_{0},v_{1}}. This is why a linear map is
represented by a matrix with columns just the images of the basis vectors.

The point of the random blob shape is that the transformation T
(determined by moving T(v_{0}) and T(v_{1}))
is applied to this blob, and so you can see from how it is transformed what the action of
T is, e.g., the vectors T(v_{0}) and T(v_{1})) can be chosen to
scale, rotate, reflect, or apply some other linear transformation to the shape.
The shape is attached to the point w, so if it is moved, the shape moves.

In this example, both source and target spaces use the same basis B.
You might choose different basis for these spaces,
to give other ways of writing T.
If we took the source basis to be {v_{0},v_{1}}
and the target basis to be {T(v_{0}),T(v_{1})}, then
the transformation matrix with respect to these basis would just look like
the identity matrix. But it's subtly different from the identity, because
the identity matrix usually is thought of as mapping a space to
itself, but in this case, it would map between two different spaces when
the additional structure of the basis is taken into account.
In the picture on this page, the same basis is used for source and target,
which is indicated by the same underlying graph paper background.
If you want to be able to compose transformations by multiplying their
matrices, you need to keep to the same basis, or make sure
to carefully match up source and target basis when composing.

Practically, in this example, how is T(w) computed, given
the values of v_{0},
v_{1}, w,
u_{0},
u_{1}, given by the user?
All these points are initially given in terms of a standard basis.
(Actually we need to take into account transforming from the space of
the mouse coords in pixels, to the local coordinate spaces for the
two graphs, but let's assume this is already done, and describe the
linear algebra from there on. )

We want a linear map T satisfying
T(v_{0})=u_{0} and
T(v_{1})=u_{1}.
It's easy to write a map (in standard basis)
taking (1,0) and (0,1) to v_{0} and v_{1}; it is a matrix
M_{1} with columns v_{0} and v_{1}.
Similarly, we have a matrix
M_{2} with columns u_{0} and u_{1}.
so, the matrix we want is T = M_{2}M_{1}^{-1}, and the point T(w) is in terms of the standard basis, given by
M_{2}M_{1}^{-1}(w).