1

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

Kabumbus
  • 438

1 Answers1

1

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.

  • Curves are not closed at all, they are more like an array of trajectories that are representations of people walking thrue a public space... – Kabumbus Jun 03 '13 at 08:29
  • @Kabumbus - as I said, in that case, there is no well defined meaning for "same direction". In any case, you can always close your curves outside your ROI. – Nathaniel Bubis Jun 03 '13 at 08:32
  • A trajectory doesn't have to be closed for direction to be well defined, otherwise how would one define the directed line segment making up a vector, or a parabolic path that is oriented in space – Triatticus Jun 03 '13 at 09:22