# Hunter Kaylor R2  Finnished Mon, Oct 1, 2007 3:41pm

from pylab import *
x=0
y=1            # for refferencing the index of r list 
r =[ [0], [0]] # Possition list of two list for X and Y each beginning at 0
t = 0.0        # initial time

# while the last element of the Y list is possivive or zero 
while r[y][-1] >= 0:
    
    #find new position and add to end of list:
    r[x].append( 0 + 3*t)                 #x a=0 , inital possition is (0,0)
    r[y].append( 0 + 4*t + (-9.8/2)* t**2)#y a=-9.8
    t += 0.01                             # as time passes
   
#print t         # this much time passed
#print max(r[x]) # max lengh m
#print max(r[y]) # max hight m

plot(r[x],r[y]) # Plot X vs Y

legend(('Path','ri <0,0>','Vi <3m/s,4m/s>','a: -9.8m/s j^','time: 0.41s','Hunter Kaylor R2'),'lower center')

xlabel('length (m)')
xlim(0,max(r[x]) + max(r[x])/64) # make gragh just a bit bigger than the maximum x value

ylabel('hight (m)')
ylim(0,max(r[y]) + max(r[y])/64)

title('Path of an Object')
grid('true')

show()
