I would like to know how I can determine if two objects following a trajectory will collide only knowing their position and velocities and acceleration due to gravity.
Example 1: A pirate shoots a cannonball from his ship, which we can call "evil ship" at another ship which we can call "victim ship". An ally of victim ship, which we can call "ally ship" tries to stop the cannonball from hitting the victim ship by trying to shoot a cannonball towards the trajectory of evil ship's cannonball, in the hopes to knock evil ship's cannonball out of its trajectory.
Problem: As soon as ally ship shoots his cannonball and we know its initial velocity, how can it be determined if his cannonball will meet with evil ship's cannonball at that moment?
Example 2: In one of the scenes in the movie "Incredibles", Mr. Incredible tries to save a man that's falling from a building by trying to jump from another building at just the right time to catch the falling man in the air and knocking him back into the building he was falling from (this happens right before "bomb voyage" appears).
Problem: As soon as Mr. Incredible jumps and we know his jump-velocity, how can it be determined if he will successfully be able to catch the falling man at that moment?
2 scenarios to keep in mind:
If Mr. Incredible jumps towards the falling man too early or too soon, he won't be able to save the man, and if the ally ship shoots too early or too soon, he won't be able to save the victim ship. In this case it's not simply checking if 2 parabolas will cross.
It shouldn't be assumed that the 2 trajectories will actually cross; it could be that Mr. Incredible jumps in a completely wrong direction or the ally ship shoots the cannonball in a completely wrong direction. In this case, just checking if the 2 parabolas will cross should be enough, because there will be no collision regardless of when Mr. Incredible jumps or when the ally ship shoots its cannonball.
The idea is to know the outcome of a possible collision between 2 objects simply by knowing their velocities and positions at any given time. This way, it can be predetermined when the collision of 2 objects will occur at the moment that the cannonball is shot (example 1) or the character jumps towards another character (example 2), before the actual collision happens (if it even happens).
It would be greatly appreciated if the math is explained in depth, including the meaning of any greek letters or symbols used to denote math terms. Also, providing an example with actual values would help a lot too.
If you know about relative motion, then if you see from frame of reference of ball A. Then you will notice that acceleration of both the balls is same (magnitude as well as direction) so wrt ball A acceleration of ball B will be zero, and relative velocity of ball B wrt ball A, will remain the same at all time( because acceleration is zero). So wrt ball A, Ball B will do straight line motion with constant velocity(=initial relative velocity). So if the direction cosines of line through ball B and ball A's initial position are equal to direction cosines of relative velocity, then definitely they will collide. (provided they are approaching each other)