Selecting Direction to Avoid Other Moving Bodies I have several point-bodies (shown below in black) moving at constant speed, with no change in orientation. Given an arbitrary point (such as the red point), how can I find which direction to move in which will most quickly maximize the distance between it and every other point? Note that the direction can only be selected once, there is no re-planning.

My current approach is to run an optimizer to maximize the sum of the distances from the red point to every other point. This works well enough if the other points aren't moving, but fails in situations such as below, where the direction which would maximize distance from static obstacles would result in colliding with them given the direction they are moving in.

Any suggestions for how to approach this?
 A: For each moving particle, calculate the minimum distance $d_i$ with the moving point. Then try to maximize the minimum of all them.


*

*Put a co-moving coordinate system on the target point.

*Describe the motion of each particle relative to the target point. So at time $t=0$ the position vectors of each particle is $\vec{r}_i$, and they move with speed $\vec{v}_i$ (all relative).

*The minimum distance of the particle to the coordinate system is $$d_i = \sqrt{ \| \vec{r}_i \|^2 - \frac{ (\vec{r}_i \cdot \vec{v}_i)^2 }{ \| \vec{v}_i \|^2 } } $$

*This occurs at time $$ t = - \frac{ \vec{r}_i \cdot \vec{v}_i }{ \| \vec{v}_i \|^2 } $$
Your control knob is the direction of movement of the reference point which changes each $\vec{v}_i$ and hence the value of $ \vec{r}_i \cdot \vec{v}_i$. 
If you use the formula for the dot product $ | \vec{a} \cdot \vec{b} | =  |\vec{a}| |\vec{b}| \cos \theta$ then the distance is
$$d_i = \sqrt{ \| \vec{r}_i \|^2 (1-\cos^2 \theta_i )}  = \| \vec{r}_i \| \sin 
\theta_i $$
where $\theta_i$ is the angle between $\vec{r}_i$ and $\vec{v}_i$
A: Calculate the position of the center of mass of the black particles, it will be a function of t. Once you have that, if you want to minimize the distance at a certain time t, you chose the angle such that your red particle will initially move away from the location that the center of mass will have at time t.
If you need a math justification let me know.
A: Start by writing a function that'll give your desired metric, i.e. the sum of distances (if that's your criteria) at some time $t$ and with the particle at $x$ and $y$:
$$ D(x, y, t) = \sum_{particles} (x(t) - X_i(t))^2+(y(t) - Y_i(t))^2 $$
in which $X_i(t)$ and $Y_i(t)$ are numbers at any particular instant; the position of the ith particle at time t. 
If the motions are linear $X_i(t) = V_{xi} t + X_{0i}$ then you can write
$$ D(x, y, t) = \sum_{particles} \sqrt{(x(t) - V_{xi} t + X_{0i})^2+(y(t) - V_{yi} t + Y_{0i})^2} $$
then assuming a linear motion of your red particle, you can directly insert that trajectory to get $D$ as just a function of time and initial velocity. This becomes (for simplicity, assuming it starts at the origin):
$$ D(t, v_x, v_y) = \sum_{particles} \sqrt{(v_x t - V_{xi} t + X_{0i})^2+(v_y t - V_{yi} t + Y_{0i})^2} $$
Finally, differentiate first by $v_x$ and then $v_y$ to give a function that will be at an extremum (hopefully a maximum) when zero.  That'll still be a function of time, because one set of $v_x, v_y$ might give a maximum at one time, while another gives a different one at a different time.  You need to think through your problem statement to know how to deal with this.
Note there's nothing in this that prevents the red ball from hitting a black one.  That can even be the right solution for maximizing the total distance.
Another note: All this math gets a lot simpler if you metric is the smallest distance squared.  Because of how $d u^2 / dx$ works, this will reduce to linear equations.
A: Far as possible from all three would put it at the center of a circle drawn through the three points.  That point will move as the particles move.  Let's say the movement of that center is on a straight line.  If that straight line does not go through the "red" particle's initial position, then at best you'll be able only to give the red particle a kick that lets it hit that moving center at one point along its trajectory.  IF the straight line does go through the point of the red particle, it's easy: just calculate the velocity of the center and give the red particle a velocity that's the same as the center's velocity.
