You are on page 1of 1

BAI3:

restart;p:=proc(v0,alpha)
local g,v0x,v0y,x,y,t,T,N,i,tt,xx,yy,p,p1,p2;
g:=9.8;
v0x:=evalf(v0*cos(alpha));
v0y:=evalf(v0*sin(alpha));
x:=v0x*t;
y:=-0.5*g*t^2+v0y*t;
T:=2*v0y/g;
N:=40;
for i to N+1 do
tt:=(i-1)/N*T;
xx:=subs(t=tt,x);
yy:=subs(t=tt,y);
p[i]:=plots[pointplot]([[xx,yy]],style=point,color=black,
symbol=circle,symbolsize=15);
end do;
p1:=plot([x,y,t=0..T],color=red);
p2:=plots[display](seq([p[i]],i=1..N+1),insequence=true);
print("Select figure then click Play.");
plots[display]([p1,p2],labels=["x(m)","y(m)"]);
end proc:
p(50,Pi/4);
BAI1:
restart;
Tchebycheff:=proc(n::nonnegint)
if n=0 then 1;
elif n=1 then x;
else expand(2*x*Tchebycheff(n-1)-Tchebycheff(n-2));
end if;
end proc:
Tchebycheff(0);
Tchebycheff(1);
Tchebycheff(2);
Tchebycheff(3);
for i in{5,10,20} do T[i]:=Tchebycheff(i):end do:
plot([T[5],T[10],T[20]],x=0..1,color=[red,green,blue]);

BAI2:

You might also like