0

I have a set of [x, y, time] values and a reference point [x, y]. The values represent 2D movement of an object over time. I would like to approximate the time at which the trajectory of the object was closest the reference point. In this diagram, the blue crosses are the set of points and the red cross is the reference point.

enter image description here

My initial approach would be to derive the linear trajectory of the object (green line below), and then find the point on the line that forms a right angle with the reference point (PT). The distance of that point between its two nearest neighbours along the trajectory line (T2 and T3) would provide an interpolated time value.

enter image description here

Is there a more efficient algorithm, or set of algorithms, for calculating the time value of PT? A linear approximation for trajectory (as opposed to a spline) is acceptable, as is some tolerance in the accuracy of the calculated time. A reference implementation (in pseudo-code/C/Java/whatever) for study would be most welcome. Many thanks.

EDIT: maybe it's easier to re-phrase in terms of GPS. Given a polyline of GPS points and the time of their reading, at what time precisely did the path go closest to this other point?

simonhaines
  • 481
  • 7
  • 22
  • The answer to this question depends on the time and distance scales. And the speed, acceleration, and turning radius of the object. For example, here's [one possible path](http://i.stack.imgur.com/TbWE7.png). – user3386109 Apr 24 '16 at 03:00
  • Yes without a trajectory this would be unsolvable, which is why I would derive either a linear trajectory (green line in diagram) or a trajectory of straight lines between points. As for time scale, pick anything you like with the constraint that T1 < T2 < T3 etc. – simonhaines Apr 25 '16 at 02:10
  • 1
    See if you find anything in this related answer useful: http://stackoverflow.com/questions/31550469/query-set-of-points-in-area-within-distance-from-line-segment/31551806#31551806 – m69's been on strike for years Apr 25 '16 at 02:39

0 Answers0