Find intersection of two x-y tracks given time element

1 view (last 30 days)
I have two tracks defined by x-y coordinates in which I would like to establish the crossing points. This appears to be relatively easy using several of the submissions on File Exchange such as Intersection and InterX . This submission a list of the x and y values of the crossing points. However it doesn’t take into account time. Let me explain....
Suppose my two tracks are for a cat and a mouse. The tracks explain where both the cat and mouse have been as a function of time using x-y coordinates. Let’s now suppose that I know that the cat always trails the mouse - that is to say that the mouse is always ahead of the cat as a function of time, never the other way round. Is there a quick way (like the File Exchange link I show) to calculate only crossing points where the cat crosses the mouses trail, not the mouse crossing the cats trail.
One solution would be to return x-y-time triplets which I could then filter to ensure the cat is behind the mouse. But I’m not sure how I could make a fast running function of this nature
  7 Comments
Mark Jackson
Mark Jackson on 19 Aug 2019
Edited: Mark Jackson on 19 Aug 2019
I hadn’t thought about the iout and jout returns. The function returns all crossing points but I was assumed it only returned x-y so repeated crossing points would be indistinguishable (in terms of time). With iout and jout it should be easy to pick out the times and then check whether mouse is ahead of cat or vice-versa. Thanks for your help! I’ll try it today and let you know how I get on
Adam Danz
Adam Danz on 19 Aug 2019
It's an interesting problem. Let me know how it works out.

Sign in to comment.

Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!