How to show the trajectory of a projectile using python?
<p>I'm fairly new to stack overflow and programming on the whole, so I apologize in advance if this question has already been asked or is a stupid question on the whole. 
How could I visually show the trajectory of a projectile after doing the calculations in python? Like a module? PyGame? Are there other languages that would be better for this? Thanks,</p>

<p>Nimrodian.</p>

<p>You can use whatever graphic module you'd like.</p>

<p>Pygame is one, right, but I believe matplotlib is probably simpler.</p>

<p>Check this :</p>

<pre><code>import matplotlib.pyplot as plt
from matplotlib.path import Path
import matplotlib.patches as patches

verts = [
    (0., 0.),  # P0
    (0.2, 1.), # P1
    (1., 0.8), # P2
    (0.8, 0.), # P3
    ]

codes = [Path.MOVETO,
         Path.CURVE4,
         Path.CURVE4,
         Path.CURVE4,
         ]

path = Path(verts, codes)

fig = plt.figure()
ax = fig.add_subplot(111)
patch = patches.PathPatch(path, facecolor='none', lw=2)
ax.add_patch(patch)

xs, ys = zip(*verts)
ax.plot(xs, ys, 'x--', lw=2, color='black', ms=10)

ax.text(-0.05, -0.05, 'P0')
ax.text(0.15, 1.05, 'P1')
ax.text(1.05, 0.85, 'P2')
ax.text(0.85, -0.05, 'P3')

ax.set_xlim(-0.1, 1.1)
ax.set_ylim(-0.1, 1.1)
plt.show()
</code></pre>

<p><a href="http://i.stack.imgur.com/1RNVU.png" rel="nofollow"><img src="http://i.stack.imgur.com/1RNVU.png" alt="http://matplotlib.org/_images/path_tutorial-2.png"></a></p>

<p>Taken from : <a href="http://matplotlib.org/users/path_tutorial.html" rel="nofollow">http://matplotlib.org/users/path_tutorial.html</a></p>

python pygame