Лабораторные работы по Python, ЛФИ, 1 семестр
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

21 lines
322 B

import turtle
turtle.shape('turtle')
Vx, Vy = 5, 50
t = 0
dt = 0.2
ay = -3
x, y = 0, 0
turtle.up()
dx0, dy0 = 250, 100
turtle.goto(-dx0, -dy0)
turtle.down()
while True:
t += dt
x += Vx * dt
y += Vy * dt + ay * dt**2/2
Vy += ay * dt
turtle.goto(x - dx0, y - dy0)
if y <= 0:
Vy = -Vy * 0.8