title: Detect if Lines Intersect in Google Charts or Plot.ly
body: <p>I have seen scripts that claim to enter coordinates and it'll tell you if they intersect, but I have an array of X,Y values for a couple of "lines" but how do I cycle through the points to find out if they intersect?</p>
  
  <p>I've included a photo of my graph and as you see, eventually my plots cross over, I just want to know if my values ever cross over (intersect).</p>
  
  <p><img src="https://aws1.discourse-cdn.com/business7/uploads/plot/original/2X/9/9565e2e0d352223ad94c569fc93b3857bf3e2fca.png" alt="Text"></p>
  
  <p>How do I run through this to find out if any intersection ever occurs?</p>
  
  <pre><code>var Test = {
   x: [8043, 10695, 13292, 17163, 20716, 25270],
   y: [1000,   274,   100,  27.4,    10,  2.74],
   fill: 'tozeroy',
   type: 'scatter',
   name: 'Test'
  };
  
  
  var Test2 = {
   x: [8043, 10063, 12491, 16081, 19408, 23763],
   y: [1000,   274,   100,  27.4,    10,  2.74],
   fill: 'tozeroy',
   type: 'scatter',
   name: 'Test2'
  };
  
  var Test3 = {
   x: [4700,  5943,  7143,  8841, 10366, 13452],
   y: [1000,   274,   100,  27.4,    10,  2.74],
   fill: 'tozeroy',
   type: 'scatter',
   name: 'Test3'
  };
  
  
  var data = [Test, Test2, Test3];
  
  var layout = {
  width: 700,
  height: 700,
  xaxis: {
   type: 'log',
   range: [3,5] 
  },
  yaxis: {
   type: 'log',
   range: [-2,3] 
  }
  </code></pre>
  
  <p>};</p>
  
  <pre><code>Plotly.newPlot('myDiv', data,layout);
  </code></pre>