%NOAIR1: MATLAB script M-file used to find the angle of %maximum distance in the case of no air resistance. %Author: Peter Howard v = 10.26; g = 9.81; H = .18; syms theta dprime = matlabFunction(diff(v*cos(theta)*(v*sin(theta)+sqrt(v^2*sin(theta)^2+2*H*g))/g,theta),'vars',theta); max_angle=fzero(dprime,pi/4) max_angle_degrees = max_angle*180/pi