2

I want to plot a graph mapping the path of a golf ball after being hit by different clubs. I have functions regarding the y and x position, with parameters α, v, and t. I want the horizontal axis to be the horizontal displacement of the golf ball at time t, and I want the vertical axis to be the vertical displacement of the golf ball at time t. I would like for the t parameter to be from 0 to 6 seconds for all golf clubs. I would also like for the angle of launch (α) and the average velocity (v) for each golf club to be inputs that I have already chosen, through research. For example, with the driver, I have chosen an angle of 14◦, and an average velocity of 70m/s. If anyone could help me out (if this is possible) or steer me in the right direction I would be very thankful as this is one of my first times using LaTeX. Thanks! (I have included my relevant equations below)

x=vt\cos(\alpha)
y=\frac{-gt^2}{2}+vt\sin(\alpha)+0.1016
Mico
  • 506,678
Marco
  • 21

1 Answers1

12

Not quite what was required, but anyway...

\documentclass[tikz,border=5]{standalone}
\usepackage[prefix=]{xcolor-material}
\begin{document}
\begin{tikzpicture}[x=(330:1cm),y=(30:1cm),z=(90:1cm)]
\fill [LightGreen] (-1,-1,0) -- (-.5,1,0) -- (11,2,0) -- (11,-2,0) -- cycle;
\fill [Green] (9,0,0) circle [x radius=1.5, y radius=1];
\fill [black] (10,0,0) circle [x radius=.1, y radius=.1];
\draw [Brown, thick, line cap=round] (10,0,0) -- (10,0,1);
\fill [Red] (10,0,1) -- (9.8,0,0.9) -- (10,0,0.8) -- cycle;
\fill [Yellow, shift={(7,0,0)}] 
  plot [domain=0:340, samples=20, smooth cycle, variable=\t] 
    (\t:rnd/16+0.25 and rnd/8+0.75);
\foreach \a [evaluate={\v=70; \T=\v*sin(\a)/9.807*2;}] in {10, 20, ..., 80} {
  \draw [x=(330:0.5pt), z=(90:0.5pt), Black, dashed]
    plot [smooth, domain=0:\T, samples=50, variable=\t] 
      (\v*\t*cos \a, 0, -9.807/2*\t^2+\v*\t*sin \a +0.1016) coordinate (end);
  \fill [White] (end) circle [radius=1pt];
}
\end{tikzpicture}
\end{document} 

enter image description here

Mark Wibrow
  • 70,437