internal VEdge(VPoint start, FortuneSite left, FortuneSite right) { Start = start; Left = left; Right = right; //for bounding box edges if (left == null || right == null) { return; } //from negative reciprocal of slope of line from left to right //ala m = (left.y -right.y / left.x - right.x) SlopeRise = left.X - right.X; SlopeRun = -(left.Y - right.Y); Intercept = null; if (SlopeRise.ApproxEqual(0) || SlopeRun.ApproxEqual(0)) { return; } Slope = SlopeRise / SlopeRun; Intercept = start.Y - Slope * start.X; }
public void Initialize(VPoint start, FortuneSite left, FortuneSite right) { Start = start; End = VPoint.Default; Left = left; Right = right; IsClipped = false; Neighbor = null; //for bounding box edges if (left == null || right == null) { return; } //from negative reciprocal of slope of line from left to right //ala m = (left.y -right.y / left.x - right.x) SlopeRise = left.X - right.X; SlopeRun = -(left.Y - right.Y); Intercept = null; if (SlopeRise.ApproxEqual(0) || SlopeRun.ApproxEqual(0)) { return; } Slope = SlopeRise / SlopeRun; Intercept = start.Y - Slope * start.X; }