# MAT 223 Second Worksheet

## 2581 days ago by kcrisman

Let's see a random plane.  Click 'update' to get another one!

var('y,z') @interact def _(auto_update=False,show_normal=checkbox(False,label="Show normal vector")): a,b,c = random(),random(),random() d = random()*5 P = a*x+b*y+c*z+d Pl = implicit_plot3d(P,(x,-5,5),(y,-5,5),(z,-5,5),axes=True) if show_normal: V = plot(vector([3*a,3*b,3*c]),color='red',thickness=5) show(V+Pl,aspect_ratio=1) else: show(Pl,aspect_ratio=1) html("Equation is $%s=0$"%latex(P))

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

This will enable you to input your own plane through a point with a given normal vector.

var('y,z') @interact def _(normal = matrix([[1,2,3]]),point = matrix([[0,0,0]]),auto_update=False): a,b,c = normal[0] d,e,f = point[0] P = a*(x-d)+b*(y-e)+c*(z-f) xmax,ymax,zmax = max(2*abs(d),5),max(2*abs(e),5),max(2*abs(f),5) V = plot(vector([a,b,c]),color='red',thickness=5) Pl = implicit_plot3d(P,(x,-2*xmax,2*xmax),(y,-2*ymax,2*ymax),(z,-2*zmax,2*zmax),axes=True) html("Equation is $%s=0$"%latex(P)) show(Pl+V,aspect_ratio=1)

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

And this allows you to do it by inputting points!

var('y,z') @interact def _(point1 = matrix([[1,2,3]]),point2 = matrix([[0,0,0]]),point3=matrix([[-1,-1,-3]]),auto_update=False): V1 = point2[0]-point1[0] V2 = point3[0]-point1[0] a,b,c = list(V1.cross_product(V2)) d,e,f = point1[0] P = a*(x-d)+b*(y-e)+c*(z-f) xmax,ymax,zmax = max(2*abs(d),5),max(2*abs(e),5),max(2*abs(f),5) V = plot(vector([a,b,c]),color='red',thickness=5) Pl = implicit_plot3d(P,(x,-2*xmax,2*xmax),(y,-2*ymax,2*ymax),(z,-2*zmax,2*zmax),axes=True) show(Pl+V,aspect_ratio=1) html("Equation is $%s=0$"%latex(P))

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