예제 #1
0
        public VoronoiEdge(Point start, FSite left, FSite right, Point end = null)
        {
            StartPoint = start;
            EndPoint   = end;
            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;
        }
예제 #2
0
 internal BeachSection(FSite site)
 {
     Site        = site;
     CircleEvent = null;
 }