Calculate intercept location and time

715 Views Asked by At

I want to calculate the coordinates and time where object B2 can intercept object B1.

Asuming the following:

All coordinates are in pixels

B1: Moves from coordinates A1 to A2, it has a speed of 2 pixels per hour and starts moving at 15:00.

B2: Moves from A3 to B1 and has a max speed of 1,5 pixels per hour and starts moving when it can intercept B1

A1: has the coordinates 20,45 (X,Y)

A2: has the coordinates 60,86 (X,Y)

A3: has the coordinates 55,78 (X,Y)

Results of the calculations I would like to achieve:

The time (00:00 - 24:00) and coordinates (X,Y) B2 is able to intercept B1 while both moving on a straight line, keeping in mind that both objects have a different movement speed.

overview

1

There are 1 best solutions below

1
On

B2 can intercept B1 as long as A3-A2 distance <= 75% of (15,0) to A2 passing by A1

Let's call the point where B1 start A0 :

B2 intercept B1 <=> dist(A3,A2) <= 75/100 (dist(A0,A1) + dist(A1,A2))

(Since 1.5 = 75% of 2)