# MAT 232 Ch. 5

## Section 5.1

The computer really helps us see what the span looks like.

@interact def _(V = matrix([,]), W = matrix([[-2],]) ): v = vector([V[0,0],V[1,0]]) w = vector([W[0,0],W[1,0]]) G = Graphics() G += v.plot() G += w.plot(color='green') for i in [-3..3]: for j in [-3..3]: G += line([(i*v+j*w,i*v+j*w),(i*v+(j+1)*w,i*v+(j+1)*w)],alpha=.5,color='red') G += line([(j*v+i*w,j*v+i*w),((j+1)*v+i*w,(j+1)*v+i*w)],alpha=.5,color='red') show(G)

## Click to the left again to hide and once more to show the dynamic interactive window

If you play around with it, note especially how the span can change "dimension".

Notice that in this case I add an option so that it's clear that not just the integer linear combinations, but all linear combinations are part of the span.

var('s,t') @interact def _(V = matrix([,,]), W = matrix([,,]),show_plane=False ): v = vector([V[0,0],V[1,0],V[2,0]]) w = vector([W[0,0],W[1,0],W[2,0]]) G = Graphics() G += v.plot(thickness=5) G += w.plot(color='green',thickness=5) for i in [-3..3]: for j in [-3..3]: G += line([(i*v+j*w,i*v+j*w,i*v+j*w),(i*v+(j+1)*w,i*v+(j+1)*w,i*v+(j+1)*w)],alpha=.5,color='red') G += line([(j*v+i*w,j*v+i*w,j*v+i*w),((j+1)*v+i*w,(j+1)*v+i*w,(j+1)*v+i*w)],alpha=.5,color='red') if show_plane: G += parametric_plot3d(s*v+t*w,(s,-3,3),(t,-3,3),color='red',alpha=.5) show(G)

show_plane

## Click to the left again to hide and once more to show the dynamic interactive window