function result=cannon_ball_distance(e,g,v) % compute the time of flight tof = 2*v*sin(e)/g; % compute the distance result = v*cos(e)*tof;