I have two arrays of points: double[] minus and double[] plus, e.g.:
double[] minus = new[]
{
24.043414306636713,
26.521399902043807,
23.049167719142361,
24.473177606966754,
18.238281854192408,
};
double[] plus = new[]
{
8.31219054269323,
9.5909890877229582,
11.066525870449567,
22.769068312057193,
24.733540360065991,
};
I need to plot 2 diagrams basing on this number and determine their positions relatively to each other: are there an intersection and which of them is under another?
How can I do that? TIA
(please feel free to retag the question or change the topic, I’m not sure in proper math terminology used)
Edit: Here’s an Excel diagram:

It’s easy to determine which is above and which is under.
How to determine that red (plus) has an intersection with blue (minus)? Using maybe LINQ?
This code can found all collisions:
EDIT:
I did two different methods to distinguish the type of collisions (i.e. between indices or on indices), but if your purpouse is just to detect if there’s a collision or not, just do the following:
This code returns as soon as a collision is found, so it’s generally faster the the above methods.