private void CompareResultPoints(MultiLinePoint brute, MultiLinePoint sweep)
        {
            Assert.IsTrue(PointD.Equals(brute.Shared, sweep.Shared, 1e-6));

            Int32[]        bruteLines     = brute.Lines, sweepLines = sweep.Lines;
            LineLocation[] bruteLocations = brute.Locations, sweepLocations = sweep.Locations;
            Assert.AreEqual(bruteLines.Length, bruteLocations.Length);
            Assert.AreEqual(sweepLines.Length, sweepLocations.Length);

            Array.Sort(bruteLines, bruteLocations); Array.Sort(sweepLines, sweepLocations);
            CollectionAssert.AreEqual(bruteLines, sweepLines);
            CollectionAssert.AreEqual(bruteLocations, sweepLocations);
        }
        public void StartBetween()
        {
            LineD[] lines = new LineD[] {
                new LineD(0, 0, 6, 0), new LineD(5, 0, 5, 6),
                new LineD(5, 5, -1, 5), new LineD(0, 5, 0, -1)
            };

            var results = FindBoth(lines);

            Assert.AreEqual(4, results.Length);
            for (int i = 0; i < results.Length; i++)
            {
                Assert.AreEqual(2, results[i].Lines.Length);
            }

            MultiLinePoint result = results[0];

            Assert.AreEqual(new PointD(0, 0), result.Shared);
            Assert.AreEqual(0, result.Lines[0]);
            Assert.AreEqual(LineLocation.Start, result.Locations[0]);
            Assert.AreEqual(3, result.Lines[1]);
            Assert.AreEqual(LineLocation.Between, result.Locations[1]);

            result = results[1];
            Assert.AreEqual(new PointD(5, 0), result.Shared);
            Assert.AreEqual(0, result.Lines[0]);
            Assert.AreEqual(LineLocation.Between, result.Locations[0]);
            Assert.AreEqual(1, result.Lines[1]);
            Assert.AreEqual(LineLocation.Start, result.Locations[1]);

            result = results[2];
            Assert.AreEqual(new PointD(0, 5), result.Shared);
            Assert.AreEqual(2, result.Lines[0]);
            Assert.AreEqual(LineLocation.Between, result.Locations[0]);
            Assert.AreEqual(3, result.Lines[1]);
            Assert.AreEqual(LineLocation.Start, result.Locations[1]);

            result = results[3];
            Assert.AreEqual(new PointD(5, 5), result.Shared);
            Assert.AreEqual(1, result.Lines[0]);
            Assert.AreEqual(LineLocation.Between, result.Locations[0]);
            Assert.AreEqual(2, result.Lines[1]);
            Assert.AreEqual(LineLocation.Start, result.Locations[1]);
        }