1
0
This commit is contained in:
2019-05-15 16:46:55 +02:00
parent 6e1f8bbf63
commit de4d08b938
3 changed files with 18 additions and 10 deletions

View File

@@ -6,7 +6,7 @@ namespace TMI_practicum
{
public static IEnumerable<Intersection> Solve(IList<Circle> circles)
{
var intersections = new List<Intersection>();
var intersections = new HashSet<Intersection>();
for (int i = 0; i < circles.Count - 1; i++)
{
@@ -15,7 +15,11 @@ namespace TMI_practicum
var c1 = circles[i];
var c2 = circles[j];
var intersects = c1.FindIntersections(c2);
if (intersects != null) intersections.AddRange(c1.FindIntersections(c2));
if (intersects == null) continue;
foreach (var intersect in intersects)
{
intersections.Add(intersect);
}
}
}