Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import graphics
- from graphics import *
- def m1():
- v = 800
- win = GraphWin("window",v,v)
- b = eval(input("velocity: "))
- c = eval(input("height: "))
- x = 0
- for i in range(1000000):
- x = x + 1
- y = ( -16 * ( (x/100) ** 2 ) ) + (b * (x/100)) + c
- dot = Line(Point(x, v-y), Point(x,v))
- bot = Point(x, v-y)
- bot.setFill("red")
- if x%100 == 0:
- dot.setFill("red")
- else:
- dot.setFill("black")
- dot.draw(win)
- bot.draw(win)
- def m2():
- v = 800
- win = GraphWin("win",v,v)
- win.setCoords(0.0,0.0,3.0,4.0)
- Text(Point(1,3), " what is the velocity: ").draw(win)
- Text(Point(1,1), " what is the initial height: ").draw(win)
- b = Entry(Point(2,3),5)
- b.draw(win)
- c = Entry(Point(2,1),5)
- c.draw(win)
- button = Text(Point(1.5,2.0), "Convert It")
- button.draw(win)
- Rectangle(Point(1,1.5),Point(2,2.5).draw(win))
- win.getMouse()
- x = Rectangle(Point(0,0),Point(v,v))
- x.setFill("white")
- try:
- b = eval(b.getText())
- c = eval(c.getText())
- except:
- print("please enter the values THEN press go :)")
- win.close()
- m1()
- x = 0
- for i in range(1000000):
- x = x + 1
- y = round(( -16 * ( (x/100) ** 2 ) ) + (b * (x/100)) + c)
- dot = Line(Point(x, v-y), Point(x,v))
- bot = Point(x, v-y)
- bot.setFill("red")
- if x%100 == 0:
- dot.setFill("red")
- else:
- dot.setFill("black")
- dot.draw(win)
- bot.draw(win)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement