
clc;
clear all;

theta = 0;
x_max = 0.00;

for theta = 0:80
	v_max = 30;
	v_throw = v_max;
	v_throw_vert = v_throw*sin(theta*pi/180);
	v_throw_hori = v_throw*cos(theta*pi/180);
	
	t_f = 2*v_throw_vert/9.81;
	
	x = v_throw_hori*t_f;
    if x_max < x
        x_max = x;
        theta_opt = theta;
        t_opt = t_f;
    end
end

t_opt
x_max
theta_opt