Submit as a script file spirals3d.m Create a single graph of the 3-D parametric
ID: 3551705 • Letter: S
Question
Submit as a script file spirals3d.m Create a single graph of the 3-D parametric equations below. Submit this as a .m script file of commands, not as a function. Use t values from 0 through 6pi with increments of 0.1. Put a grid on your graph and label your axes (x, y and z will do for labels).
x = sqrt((t) sin(2t)),
y = sqrt((t) cos(2t)),
z = 0.5t
Your single graph (which is actually two graphs in the same window) should look like this:
Explanation / Answer
t=0:0.1:6*pi;
x=sqrt(t.*sin(2*t));
y=sqrt(t.*cos(2*t));
z=0.5*t;
subplot(1,2,1)
plot3(x,y,z)
xlabel('x')
ylabel('y')
zlabel('z')
grid on
subplot(1,2,2)
plot(x,y)
xlabel('x')
ylabel('y')
grid on