You are on page 1of 3

Kevin García

A01252037

March 24th, 2021

F1016B Grupo 4

Exercise 1: Plot in Matlab the parametric curve between 0 and 8 seconds.

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

% how plot point by point ?


% how get only positive y values

for i=1:length(t)
plot(x(i),y(i), 'ob','MarkerSize',4,'MarkerFaceColor','red');
pause(0.1);
end

fprintf("Time when the ball reach the grass %.4f \n",tmp);

Time when the ball reach the grass 0.0000

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

%no olvidar el punto para vectores


tp=[0 1 2 3 4 5 6];
xp = tp.*cos(tp);
yp = tp.*sin(tp);
zp = tp;
plot3(xp, yp,zp,'ob','MarkerSize',9,'MarkerFacecolor','blue');

2
3

You might also like