%auto
var('x,y,z')
@interact
def _(A=input_box(default=x^2*z,label='$F_1(x,y,z) = $'),
B=input_box(default=-2*x*z,label='$F_2(x,y,z) = $'),
C=input_box(y*z,label='$F_3(x,y,z) = $'),
threed=checkbox(default=true,label='3D view'),
vector_field=checkbox(default=true,label='Show Vector Field'),
curl_field=checkbox(default=true,label='Show Curl Field'),
more_pts=checkbox(default=False,label='More Vectors?'),
way_more_pts=checkbox(default=False,label='Lots More Vectors?'),
scale_factor=slider(1/20,2,1/20,1/5)):
field = (A,B,C)
curlf = (derivative(C,y)-derivative(B,z),derivative(C,x)-derivative(A,z),derivative(B,x)-derivative(A,y))
if way_more_pts:
density_vectors = 10
elif more_pts:
density_vectors = 8
else:
density_vectors = 5
H = Graphics()
if vector_field:
H+=plot_vector_field3d_unscaled(field, (x,-1,1), (y,-1,1), (z,0,2*pi),factor=scale_factor, plot_points=density_vectors,colors=['green','green','green'],box='False')
H+=text3d("Vector Field.",(1,1,6.8),color='green')
if curl_field:
H+=plot_vector_field3d_unscaled(curlf, (x,-1,1), (y,-1,1), (z,0,2*pi),factor=scale_factor, plot_points=density_vectors,colors=['red','red','red'],box='False',opacity=0.5)
H+=text3d("Curl Field.",(1,1,6.5))
if threed:
show(H,stereo='redcyan',spin=true,figsize=(8,12))
else:
show(H,spin=true,perspective_depth=true,figsize=(8,12))
|
Click to the left again to hide and once more to show the dynamic interactive window
|