% Shooting demonstration
% using fzero 
%
% CCK 2009-Mar-12 / updated 2022-Apr-13
%
% NOTE: Had to install octave-forge-optim to get fzero.
function shoot_fast(vguess)

hold off
miss(vguess,'b-+');
hold on % overplot all the misses


vbest = fzero(@miss, vguess)

% Adjust the axes for a nice plot.
xlabel('distance (m)')
ylabel('height (m)')
axis([-8,4,0,6])
axis equal


miss(vguess(1),'b-+');
miss(vbest,'g-x');
plot(0,3,'bo');
title('Three Point Field Goal','fontsize',20)
hold off