Untitled

898 days ago by pub

We are exploring how to parameterize curves in 3D.



Example 1: Parameterize the curve defined as the intersection of the 2 surfaces: $z=x^2-y$ and $z=2x$.  YouTube Video

Example 2: Parameterize the curve defined as the intersection of the 2 surfaces: $y=x^2+z^2$ and $z=\frac{y}{2}$.  YouTube Video



Example 1: Parameterize the curve defined as the intersection of the 2 surfaces: $z=x^2-y$ and $z=2x$.

var ('x y z') #Define a 3d curve as the intersection of 2 surfaces z1=x^2-y z2=2*x 
       
# Let's plot xmin=-3; xmax=5; ymin=-3; ymax=9; zmin=-6; zmax=10; # Axes Ax=line3d(([xmin,0,0],[xmax,0,0]), thickness=2, color='red') Ay=line3d(([0,ymin,0],[0,ymax,0]), thickness=2, color='blue') Az=line3d(([0,0,zmin],[0,0,zmax]), thickness=2, color='green') # Surfaces S1=plot3d(z1,(x,xmin,xmax),(y,ymin,ymax), opacity=0.4, color='yellow') S2=plot3d(z2,(x,xmin,xmax),(y,ymin,ymax), opacity=0.4, color='purple') # Cutoff S3=implicit_plot3d(y==8, (x,xmin,xmax),(y,ymin,ymax),(z,zmin,zmax), opacity=0.2, color='teal') show(S1+S2+S3+Ax+Ay+Az, aspect_ratio=[3,2,1]) 
       
var ('t') #Define a 3d curve s (parametrically) and an interval for t s=vector((t,t^2-2*t,2*t)) t1=-2; t2=4 # Let's plot s C=parametric_plot(s,(t,t1,t2), thickness=10) show(C+S1+S2+S3+Ax+Ay+Az, aspect_ratio=[3,2,1]) 
       


Example 2: Parameterize the curve defined as the intersection of the 2 surfaces: $y=x^2+z^2$ and $z=\frac{y}{2}$.   YouTube Video

var ('x y z') #Define a 3d curve as the intersection of 2 surfaces #(but not explicit in z so we must use implicit plots) # Let's plot xmin=-3; xmax=3; ymin=-1; ymax=5; zmin=-3; zmax=3; # Axes Ax=line3d(([xmin,0,0],[xmax,0,0]), thickness=2, color='red') Ay=line3d(([0,ymin,0],[0,ymax,0]), thickness=2, color='blue') Az=line3d(([0,0,zmin],[0,0,zmax]), thickness=2, color='green') # Surfaces S1=implicit_plot3d(y==x^2+z^2,(x,xmin,xmax),(y,ymin,ymax),(z,zmin,zmax), opacity=0.4, color='yellow') S2=implicit_plot3d(z==y/2,(x,xmin,xmax),(y,ymin,ymax),(z,zmin,zmax), opacity=0.4, color='purple') show(S1+S2+Ax+Ay+Az, aspect_ratio=[1,1,1]) 
       
var ('t') #Define a 3d curve s (parametrically) and an interval for t s=vector((cos(t),2*(sin(t)+1),sin(t)+1)) t1=0; t2=2*pi # Let's plot s C=parametric_plot(s,(t,t1,t2), thickness=10) show(C+S1+S2+Ax+Ay+Az, aspect_ratio=[1,1,1]) 
       
# For fun, we have added our first range set here so you can see how we changed it above var ('x y z') #Define a 3d curve as the intersection of 2 surfaces #(but not explicit in z so we must use implicit plots) # Let's plot xmin=-3; xmax=3; ymin=-3; ymax=3; zmin=-3; zmax=3; # Axes Ax=line3d(([xmin,0,0],[xmax,0,0]), thickness=2, color='red') Ay=line3d(([0,ymin,0],[0,ymax,0]), thickness=2, color='blue') Az=line3d(([0,0,zmin],[0,0,zmax]), thickness=2, color='green') # Surfaces S1=implicit_plot3d(y==x^2+z^2,(x,xmin,xmax),(y,ymin,ymax),(z,zmin,zmax), opacity=0.4, color='yellow') S2=implicit_plot3d(z==y/2,(x,xmin,xmax),(y,ymin,ymax),(z,zmin,zmax), opacity=0.4, color='purple') show(S1+S2+Ax+Ay+Az, aspect_ratio=[1,1,1])