# Please do not post homework # Matthew Esaia, 2/2/2025, Homework 3 # 6.1 2-dimensional plotting print(`Section 6.1`); plot(sin(x), x=-2*Pi..2*Pi); #plot(sec(x), x=-Pi..2*Pi,y=-5..5); # Parametric plotting #plot([cos(t), 1/2*sin(t), t=0..2*Pi]); # Multiple plots p1 := plot([sqrt(x), 3*log(x)], x=0..400, numpoints=1000, title=`The Square Root and log functions`); display(p1); # Polar plots with(plots): polarplot(cos(5*t), t=0..2*Pi); # Plotting points L := [[0, 0], [1,1], [2,3], [3,2], [4,-2]]: plot(L, style=point); # 6.2 3-dimensional plotting print(`Section 6.2`); plot3d(exp(-(x^2 + y^2 - 1)^2), x=-2..2, y=-2..2, grid=[50,50]); # Parametric plotting #plot3d([sqrt(1+u^2)*cos(t), sqrt(1+u^2)*sin(t),u], u=-1..1, t=0..2*Pi); # Space curves spacecurve([cos(t), sin(t), t], t=0..4*Pi, numpoints=200); # Contour plots contourplot(exp(-(x^2+y^2-1)^2), x=-(1.3)..(1.3), y=-(1.3)..(1.3), filled=true, coloring=[blue,red]); #contourplot3d(exp(-(x^2+y^2-1)^2), x=-(1.3)..(1.3), y=-(1.3)..(1.3), filled=true, coloring=[blue,red]); # 6.3 Animation print(`Section 6.3`); animate(1/(1+x*t), x=0..10, t=0..1, frames=50); animate3d([r*cos(t+a), r*sin(t+a), r^2*cos(2*t)], r=0..1, t=0..2*Pi, a=0..3, frames=10, style=patch, title=`The Rotating Saddle`); animate3d([r*cos(t+a), r*sin(t+a), r^2*cos(2*t)+sin(a)], r=0..1, t=0..2*Pi, a=0..2*Pi, frames=10, style=patch, title=`The Flying Pizza`);