All,
In the second image in this file, I am disappointed to find that the vector
doesn't look tangent to the path at the tip of the position vector.
input mp-tool;
beginfig(1);
%initialize scale
numeric u; 6u=3in;
%draw coordinate axes
drawdblarrow (-1u,0)--(5u,0);
label.rt(btex $x$ etex, (5u,0));
drawdblarrow (0,-1u)--(0,3u);
label.top(btex $y$ etex, (0,3u));
%path
path p;
p:=(-1,1)..(1,2)..(5,2.5);
p:=p scaled u;
draw p withcolor blue;
%position vector
drawarrow (0,0)--(1u,2u) withcolor red;
label.lrt(btex ${\bf r}(t)$ etex, 0.5[(0,0),(1u,2u)]);
dotlabel.ulft(btex $(x(t),y(t))$ etex, (1u,2u));
endfig;
beginfig(2);
%initialize scale
numeric u; 6u=3in;
%draw coordinate axes
drawdblarrow (-1u,0)--(5u,0);
label.rt(btex $x$ etex, (5u,0));
drawdblarrow (0,-1u)--(0,3u);
label.top(btex $y$ etex, (0,3u));
%path
path p;
p:=(-1,1)...(1,2)...(5,2.5);
%position vector
drawarrow (0,0)--(1u,2u) withcolor red;
label.lrt(btex ${\bf r}(t)$ etex, 0.5[(0,0),(1u,2u)]);
dotlabel.ulft(btex $(x(t),y(t))$ etex, (1u,2u));
%calculate the velocity vector
numeric t;
t:=directiontime (1u,2u) of p;
pair d;
d:=direction t of p;
drawarrow ((0,0)--d) scaled u shifted (1u,2u);
p:=p scaled u;
draw p withcolor blue;
endfig;
end.