It is quite complicated. You have a straight line which is the ball trajectory after hitting it and you want the shortest right angle distance to that line, but eliminating anything that isn't catchable (e.g. above about 7-8 feet off the ground). There are probably some maths equations online that will solve this.
You can probably break it up into approximations. Standard equations will generate the trajectory of the ball from the impact of bat on ball and you can calculate it every couple of metres or so, working out if the fielder (do the basemen chase the ball ? English !) can get to that point in the elapsed time.
The problem is a human instinctively knows whether they can catch or get a ball or not, or someone else is better placed to do so.
Having written several cricket simulators over the years (a similar hit bat with ball and fielders game popular in the UK and other countries) it is very difficult to realistically simulate a swinging bat versus a moving ball accurately. Baseball is worse because the bat is round. Generally you cheat Most games rely on lining up and timing to determine where the ball is hit. Accurately simulating a pitchers behaviour "trying to trap a batsman" is even worse.
The thing to do is make it fun. Stick Cricket for example is absolutely awful as an accurate simulation of cricket. But its fun.
Someone from India (play cricket a lot there) asked me about this professionally, how do you accurately simulate the effect of bat on ball ; I suggested they don't, make it approximate, make it fun.