Calculations:
g = 9.81; (Acceleration due to gravity in m/s^2)
v = (Initial velocity)
theta = (Launch angle)
theta_rad = theta * %pi / 180 = (Convert angle from degrees to radians)
t_flight = 2 * v * sin(theta_rad) / g = (Calculate time of flight)
R = v * cos(theta_rad) * t_flight = (Calculate horizontal range)
t = linspace(0, t_flight, 100); (100 points for a smooth curve)
x = v * cos(theta_rad) * t; (Horizontal position as a function of time)
y = v * sin(theta_rad) * t - 0.5 * g * t.^2; (Vertical position as a function of time)