答案1
就这样。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{patterns}
\begin{document}
\begin{tikzpicture}[>=latex]
% Ground
\fill[pattern=north east lines] (-.5,-.3) rectangle (5.5,0);
% Axes
\draw[->] (-.5,0) -- (5.5,0) node[above] {$x$};
\draw[->] (0,-.5) -- (0,2.2) node[right] {$z$};
\draw[->] (-.5,1.25) node[left] {$\vec{g}$} -- (-.5,.75);
% Parabola
\def\a{-.25}
\def\xn{2.5}
\draw[dashed,blue,->] plot[domain=0:5] (\x,{\a*((\x-\xn)^2 - (\xn)^2)});
% Draw initial velocity
\draw[->] (0,0) -- (.5,{\a*(0-\xn)}) node[above left] {$\vec{v}_0$};
\draw (.5,0) node[above right] {$\theta$} arc (0:{atan(\a*(0-\xn)/.5)}:.5);
% Draw ball
\def\xb{1}
\node[draw,circle,shade,ball color=red] at (\xb,{\a*((\xb-\xn)^2 - (\xn)^2)}) {};
\draw[->] (\xb,{\a*((\xb-\xn)^2 - (\xn)^2)}) -- +(.5,{\a*(\xb-\xn)}) node[above] {$\vec{v}(t)$};
\end{tikzpicture}
\end{document}
只是为了好玩!
\documentclass[tikz]{standalone}
\usetikzlibrary{patterns}
\begin{document}
\foreach \xb in {0,.1,...,5} {
\begin{tikzpicture}[>=latex]
% Ground
\fill[pattern=north east lines] (-.5,-.3) rectangle (5.5,0);
% Axes
\draw[->] (-.5,0) -- (5.5,0) node[above] {$x$};
\draw[->] (0,-.5) -- (0,2.2) node[right] {$z$};
\draw[->] (-.5,1.25) node[left] {$\vec{g}$} -- (-.5,.75);
% Parabola
\def\a{-.25}
\def\xn{2.5}
\draw[dashed,blue,->] plot[domain=0:5] (\x,{\a*((\x-\xn)^2 - (\xn)^2)});
% Draw initial velocity
\draw[->] (0,0) -- (.5,{\a*(0-\xn)}) node[above left] {$\vec{v}_0$};
\draw (.5,0) node[above right] {$\theta$} arc (0:{atan(\a*(0-\xn)/.5)}:.5);
% Draw ball
\node[draw,circle,shade,ball color=red] at (\xb,{\a*((\xb-\xn)^2 - (\xn)^2)}) {};
\draw[->] (\xb,{\a*((\xb-\xn)^2 - (\xn)^2)}) -- +(.5,{\a*(\xb-\xn)}) node[above] {$\vec{v}(t)$};
\end{tikzpicture}
}
\end{document}
排版后,使用ImageMagick制作动画gif
$ convert -density 300 -delay 8 -loop 0 -background white -alpha remove test.pdf test.gif