title: projectile motion simple simulation using numpy matplotlib python
body: <p>I am trying to graph a projectile through time at various angles. The angles range from 25 to 60 and each initial angle should have its own line on the graph. The formula for "the total time the projectile is in the air" is the formula for t. I am not sure how this total time comes into play, because I am supposed to graph the projectile at various times with various initial angles. I imagine that I would need x,x1,x2,x3,x4,x5 and the y equivalents in order to graph all six of the various angles. But I am confused on what to do about the time spent. </p>
  
  <pre><code>import numpy as np 
  import matplotlib.pylab as plot 
  
  #initialize variables 
  #velocity, gravity
  v = 30 
  g = -9.8 
  #increment theta 25 to 60 then find  t, x, y
  #define x and y as arrays 
  theta = np.arange(25,65,5)   
  
  t = ((2 * v) * np.sin(theta)) / g #the total time projectile remains in the #air
  t1 = np.array(t) #why are some negative 
  
  
  
  x = ((v * t1) * np.cos(theta))
  y = ((v * t1) * np.sin(theta)) - ((0.5 * g) * (t ** 2))
  
  plot.plot(x,y)
  plot.show()
  </code></pre>