Euler method
Let us consider a very simple 1D problem: starting from the origin \(x = 0\), we are heading to the right with some speed \(v\). A very natural first question is: where will I be after one second? If the velocity were constant, the answer would be simple: position is just “speed times time.”
Let us apply the reasoning to our gorillas. Place the gorilla at the origin \((0,0)\), and imagine that it tosses a banana with some known initial speed and direction. In two dimensions, this motion naturally splits into two independent directions. The horizontal motion only depends on the horizontal component of the velocity, while the vertical motion depends on the vertical component. This separation is important: gravity affects only the vertical direction, leaving the horizontal motion unchanged.
With this in mind, we can describe the motion step by step. Over the first second, the projectile moves according to its initial velocity. Then gravity slightly reduces the vertical velocity. Over the next second, the projectile again moves using this updated velocity, and so on. By repeating this simple reasoning we build the entire trajectory as a sequence of points in time.
import numpy as np
g = -9.81 # gravity, m/s^2
speed = 30 # initial speed (m/s)
angle = 45 # launch angle in degrees
x, y = 0, 0 # current state
vx, vy = speed * np.cos(angle * np.pi/180), \
speed * np.sin(angle * np.pi/180)
dt = 1
while y >= 0:
x += dt * vx
y += dt * vy
vy += g * dt

Although this description is approximate, refining the time step will gradually reveal the smooth parabolic path familiar from physics.

We have a projectile starting at \((x_0, y_0) = (0,0)\), with initial velocity \((v_{x,0}, v_{y,0})\), under constant gravity \(g\) acting downward. No air resistance.
The ODEs are:
2. Euler integration scheme
With a time step \(\Delta t\), the Euler update rules are:
Let’s write the explicit formula for \(x_i\) and \(y_i\).
Let \(t := i \Delta t\). Then
As \(\Delta t \to 0\):
