Ejemplo n.º 1
0
        //
        // Do these segments creates an X?
        //
        public bool Crosses(Segment that)
        {
            Point p = this.FindIntersection(that);

            if (p == null)
            {
                return(false);
            }

            return(this.PointLiesOnAndExactlyBetweenEndpoints(p) && that.PointLiesOnAndExactlyBetweenEndpoints(p));
        }
Ejemplo n.º 2
0
        public bool DefinesDiameter(Segment seg)
        {
            if (!seg.PointLiesOnAndExactlyBetweenEndpoints(center)) return false;

            return this.PointLiesOn(seg.Point1) && this.PointLiesOn(seg.Point2);
        }
Ejemplo n.º 3
0
        //
        // Do these segments creates an X?
        //
        public bool Crosses(Segment that)
        {
            Point p = this.FindIntersection(that);

            if (p == null) return false;

            return this.PointLiesOnAndExactlyBetweenEndpoints(p) && that.PointLiesOnAndExactlyBetweenEndpoints(p);
        }
Ejemplo n.º 4
0
        private List<Atomizer.AtomicRegion> ConvertToSemicircle(Segment diameter, Semicircle semi)
        {
            // Verification Step 2.
            if (!diameter.PointLiesOnAndExactlyBetweenEndpoints(semi.theCircle.center))
            {
                throw new Exception("Semicircle: expected center between endpoints.");
            }

            Sector sector = new Sector(semi);

            return Utilities.MakeList<AtomicRegion>(new ShapeAtomicRegion(sector));
        }