Having objects trajctories and directions how to find where objects traverse same path?

46 Views Asked by At

I have N objects that travel on some trajectories (unique for each object). At each agent curve point we can get object speed (direction). Having some distance creteria d how to find where more than one curve go in same direction cloze to each other with distance <= d?

alike having black object trajectory curves we find red curve that with some d follows most curves direction:

enter image description here

1

There are 1 best solutions below

3
On

Unfortunately, "same direction" is not well defined unless the curves are closed. Say your curves are indeed closed, then the sign of the winding number of the curves described by $g_i(t) = (x_i(t),y_i(t))$ can give you the "direction" of each of the curves. Now split the curves into clockwise and counter-clockwise groups, and find the closest points between curves in each group - i.e for each pair of oriented curves find $t_1^0$ and $t_2^0$ such that: $$\frac{\partial\sqrt{\left(x_i(t_1)-x_j(t_2)\right)^2+\left(y_i(t_1)-y_j(t_2)\right)^2}}{\partial t_{1,2}}=0$$ Now check if: $$\sqrt{\left(x_i(t_1^0)-x_j(t_2^0)\right)^2+\left(y_i(t_1^0)-y_j(t_2^0)\right)^2}<d$$ QED.