fixes
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user