fixes
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
Het programma kan op volgende manieren uitgevoerd worden:
|
Het programma kan op volgende manieren uitgevoerd worden:
|
||||||
|
|
||||||
- mono TMI_practicum.exe invoer.txt uitvoer.txt
|
- 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.)
|
- 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.
|
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 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.
|
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.
|
|
||||||
|
@@ -116,6 +116,7 @@ namespace TMI_practicum
|
|||||||
if (intersects == null) return;
|
if (intersects == null) return;
|
||||||
foreach (var intersection in intersects)
|
foreach (var intersection in intersects)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (intersections.Contains(intersection)) continue;
|
if (intersections.Contains(intersection)) continue;
|
||||||
events.Add(new Event(Event.EventType.Intersection, intersection.X, circle, intersection.Y,
|
events.Add(new Event(Event.EventType.Intersection, intersection.X, circle, intersection.Y,
|
||||||
new[] {new C5.KeyValuePair<SegmentKey, Circle>(segment, circle), neighbour}));
|
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)
|
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
|
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)
|
||||||
: 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);
|
||||||
|
Reference in New Issue
Block a user