#!/usr/bin/env python

from Tuple4 import Vector, Point


def tick(env, proj):
    position = proj.position + proj.velocity
    velocity = proj.velocity + env.gravity + env.wind
    return projectile(position, velocity)


class projectile:
    def __init__(self, position, velocity):
        self.position = position
        self.velocity = velocity


class environment:
    def __init__(self, gravity, wind):
        self.gravity = gravity
        self.wind = wind


p = projectile(Point(0, 1, 0), Vector(1, 1, 0).normalize())
e = environment(Vector(0, -0.1, 0), Vector(-0.01, 0, 0))

print("x={x}, y={y}".format(x=p.position.x, y=p.position.y))
while (p.position.y >= 0):
    p = tick(e, p)
    print("x={x}, y={y}".format(x=p.position.x, y=p.position.y))
