%NOAIR2: 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; dprime = @(th) -v*sin(th)*(v*sin(th) + sqrt(v^2*sin(th)^2 + 2*g*H))/(2*g) + v*cos(th)*(v*cos(th) + v*v*sin(th)*cos(th)*1/sqrt(v^2*sin(th)^2 + 2*g*H))/(2*g); max_angle=fzero(dprime,pi/4) max_angle_degrees = max_angle*180/pi