clc;
clear all;
theta = 0;
v_run = 7;

%run = [0:0.1:10];
run = 5;
run_mod = run*90/7;
v_throw = 5.45*sin(run_mod*pi/180);

theta_opt = 0;
x_max = 0.00;
g = 9.81;

for theta = 0:0.1:80
	v_release = 7.25*v_throw*cosd(0.5*theta);
	v_release_vert = v_release*sind(theta);
	v_release_hori = v_release*cosd(theta);
	
	t_f = 2*v_release_vert/(g);
	
	x = v_release_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