Calculate required impulse to reach the spot.

Good day friends.Around three days can`t resolve a problem with impulse calculation(Porbably because my physics knowledge is very poor).

In Figure 1(Fig.1) and Figure 2(Fig.2) are conditions which requires to calculate Velocity of a body for succesefull landing.

What we know:
bodyVelocity,
bodyPosition,
targetPosition.

Question is : How to calculate velocity to reach the spot?


https://preview.ibb.co/fRWAck/problem.png

I have been searching before posting this topic but found nothing(maybe i didn’t realize that problem is similar?!).
Thanks for your time!

If you think of your angry circular player as a “bullet” and given that it always jumps with the same velocity magnitude/speed you can search for “ballistic trajectory angle to target” and get:
https://blog.forrestthewoods.com/solving-ballistic-trajectories-b0165523348c#891a
This gets you the angle at which to jump (relative to the horizontal x axis) given the delta x and delta y between the position to jump from and the target landing position.
In Java this works like this:


float g = 9.81f; // <- acceleration of gravity
float dx = targetPosition.x - playerPosition.x;
float dy = targetPosition.y - playerPosition.y;
float v = 20.0f; // <- magnitude of jump velocity
float v2 = v * v;
float sqrt = (float) Math.sqrt(v2 * v2 - g * (g * dx * dx + 2 * dy * v2));
// If it is possible to reach the target, you'll always get two possible shot/jump angles.
// One for an indirect "high arc" shot and one which is most direct "low arc".
float hiangle = (float) Math.atan2(v2 + sqrt, g * x); // <- "high arc" angle
float loangle = (float) Math.atan2(v2 - sqrt, g * x); // <- "low arc" angle
// If it is not possible to jump to the target, you'll get NaN
// If you are not so much into angles, but prefer vectors, then your jump direction is:
Vector jumpHi = normalize(vector(g * x, v2 + sqrt));
Vector jumpLo = normalize(vector(g * x, v2 - sqrt));

You need to split your equations in to two and work out the velocity where they are both equal.

The horizontal equation, assuming no air resistance

distanceHorizontal = initial velocity(horizontal) * time

You can reach arrange and work out the time t to travel horizontally to your chosen spot.

The vertical equation assuming gravity

distanceVertical = initial velocity(vertical) * time - (1/2)*gravityAcceleration * time * time

Again you can rearrange to get the time on one side (just a simple quadratic).

Now you have two equations in t, now find the velocity values which give you the same t for a given distance in the horizontal and vertical

I haven’t given you the answer (as I am on my phone) but hopefully you have enough to go on to work this out yourself