1
0
This commit is contained in:
2019-05-24 11:57:38 +02:00
parent 91cc0bce3a
commit 69e87562a5
2 changed files with 3 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
Het programma kan op volgende manieren uitgevoerd worden:
- mono TMI_practicum.exe invoer.txt uitvoer.txt
- mono TMI_practicum.exe invoer.txt (de uitvoer wordt in output.txt geplaatst.
- mono TMI_practicum.exe invoer.txt (de uitvoer wordt in output.txt geplaatst.)
- mono TMI_practicum.exe (zonder argument wordt 'input.txt' gezocht en de uitvoer in output.txt geplaatst.)
Alle dll's moeten in de map naast het uitvoerbaar bestand staan.
@@ -9,4 +9,3 @@ Alle dll's moeten in de map naast het uitvoerbaar bestand staan.
Voor algoritme 1 en 2 werken alle gevallen.
Voor algoritme 3 werken de gevallen waarbij een bepaalde cirkel volledig in een andere cirkel gelegen is en dan snijdt met een andere cirkel niet.
De uitvoer wordt in output.txt geplaatst.

View File

@@ -116,6 +116,7 @@ namespace TMI_practicum
if (intersects == null) return;
foreach (var intersection in intersects)
{
if (intersections.Contains(intersection)) continue;
events.Add(new Event(Event.EventType.Intersection, intersection.X, circle, intersection.Y,
new[] {new C5.KeyValuePair<SegmentKey, Circle>(segment, circle), neighbour}));
@@ -239,7 +240,7 @@ namespace TMI_practicum
private static double CalculateY(Circle circle, SegmentKey.SegmentType type)
{
if (_sweepline > circle.X + circle.R || _sweepline < circle.X - circle.R) return circle.Y;
if (_sweepline >= circle.X + circle.R || _sweepline <= circle.X - circle.R) return circle.Y;
return type == SegmentKey.SegmentType.Upper
? Math.Round(Math.Sqrt(circle.R * circle.R - Math.Pow(_sweepline - circle.X, 2)) + circle.Y, 14)
: Math.Round(-Math.Sqrt(circle.R * circle.R - Math.Pow(_sweepline - circle.X, 2)) + circle.Y, 14);