Professional Documents
Culture Documents
A01252037
F1016B Grupo 4
t=0:0.1:8;
x = 90 * cos(40*pi/180) * t; % observe the * notation
y = 6 + 90 * sin(40*pi/180) * t - 16 * t.^2; % observe the .^ notation
tmp=0;
figure(1);
% axis([0 300 0 60]);
hold on; % hold on is to keep previous plotted points
for i=1:length(t)
plot(x(i),y(i), 'ob','MarkerSize',4,'MarkerFaceColor','red');
pause(0.1);
end
Exercise 2: Plot the parametric curve between 0 and 8 seconds (include position in t=1, t=2 andt=3seconds).
tp=[1 2 3];
xp = 90 * cos(40*pi/180) * tp;
yp = 6 + 90 * sin(40*pi/180) * tp - 16 * tp.^2;
plot(xp, yp,'ob','MarkerSize',9,'MarkerFacecolor','blue');
1
Exercise 4: Graphing a Curve Defined by Parametric Equations (oneparameter).
t=0:0.1:2*pi;
x = t.*cos(t);
y = t.*sin(t);
z = t;
tmp=0;
figure(41);
%axis([0 300 0 60]);
hold on; % hold on is to keep previous plotted point
% how plot point by point ?
%for i=1:length(t)
plot3(x,y,z,'ob','MarkerSize',4,'MarkerFacecolor','red');
xlabel('X'), ylabel('Y'), zlabel('Z');
grid on;
%pause(0.1);
%end
2
3