Exemple #1
0
        public Arc OtherArc(Arc thatArc)
        {
            if (ca1.StructurallyEquals(thatArc)) return ca2;
            if (ca2.StructurallyEquals(thatArc)) return ca1;

            return null;
        }
Exemple #2
0
        public override bool HasSubArc(Arc that)
        {
            if (!this.theCircle.StructurallyEquals(that.theCircle)) return false;

            if (that is MajorArc || that is Semicircle) return false;

            return this.HasMinorSubArc(that);
        }
        public bool AddArcMeasureDegree(Arc thatArc, double measure)
        {
            if (ArcMeasureKnown(thatArc)) return false;

            arcs.Add(new KeyValuePair<Arc, double>(thatArc, measure));

            return true;
        }
Exemple #4
0
        public Sector(Arc a)
        {
            theArc = a;
            radius1 = new Segment(theArc.theCircle.center, theArc.endpoint1);
            radius2 = new Segment(theArc.theCircle.center, theArc.endpoint2);

            thisAtomicRegion = new ShapeAtomicRegion(this);
        }
Exemple #5
0
        public static ConcreteAST.Point AcquireRestrictedPoint(List <ConcreteAST.Point> points, ConcreteAST.Point that,
                                                               ConcreteAST.Arc arc1, ConcreteAST.Arc arc2)
        {
            ConcreteAST.Point pt = AcquirePoint(points, that);

            if (pt == null)
            {
                return(null);
            }

            return(!arc1.PointLiesOn(pt) || !arc2.PointLiesOn(pt) ? null : pt);
        }
Exemple #6
0
        public override bool HasSubArc(Arc that)
        {
            if (!this.theCircle.StructurallyEquals(that.theCircle)) return false;

            if (that is MajorArc) return this.HasMajorSubArc(that);
            if (that is Semicircle)
            {
                Semicircle semi = that as Semicircle;
                return this.HasMinorSubArc(new MinorArc(semi.theCircle, semi.endpoint1, semi.middlePoint)) &&
                       this.HasMinorSubArc(new MinorArc(semi.theCircle, semi.endpoint2, semi.middlePoint));
            }

            return this.HasMinorSubArc(that);
        }
Exemple #7
0
        public CongruentArcs(Arc a1, Arc a2)
            : base()
        {
            ca1 = a1;
            ca2 = a2;

            if (!Utilities.CompareValues(a1.theCircle.radius, a2.theCircle.radius))
            {
                throw new ArgumentException("Arcs deduced congruent when radii differ " + this);
            }

            if (!Utilities.CompareValues(a1.minorMeasure, a2.minorMeasure))
            {
                throw new ArgumentException("Arcs deduced congruent when measure differ " + this);
            }
        }
Exemple #8
0
        //
        // Orthogonal
        //
        //
        // Orthogonal arcs intersect at 90^0: radii connecting to intersection point are perpendicular.
        //
        public bool AreOrthognal(Arc thatArc)
        {
            if (!this.theCircle.AreOrthognal(thatArc.theCircle)) return false;

            // Find the intersection points
            Point inter1;
            Point inter2;
            this.theCircle.FindIntersection(thatArc.theCircle, out inter1, out inter2);

            // Is the intersection between the endpoints of both arcs? Check both.
            if (Arc.BetweenMinor(inter1, this) && Arc.BetweenMinor(inter1, thatArc)) return true;
            if (Arc.BetweenMinor(inter2, this) && Arc.BetweenMinor(inter2, thatArc)) return true;

            return false;
        }
Exemple #9
0
        public static bool StrictlyBetweenMinor(Point m, Arc originalArc)
        {
            if (m == null) return false;

            if (originalArc.HasEndpoint(m)) return false;

            return BetweenMinor(m, originalArc);
        }
Exemple #10
0
        //
        // Is M between A and B in the minor arc
        //
        public static bool BetweenMinor(Point m, Arc originalArc)
        {
            if (m == null) return false;

            // Is the point on this circle?
            if (!originalArc.theCircle.PointLiesOn(m)) return false;

            // Create two arcs from this new point to the endpoints; just like with segments,
            // the sum of the arc measures must equate to the overall arc measure.
            MinorArc arc1 = new MinorArc(originalArc.theCircle, m, originalArc.endpoint1);
            MinorArc arc2 = new MinorArc(originalArc.theCircle, m, originalArc.endpoint2);

            return Utilities.CompareValues(arc1.minorMeasure + arc2.minorMeasure, originalArc.minorMeasure);
        }
Exemple #11
0
        //
        // If it's on the circle and not in the minor arc, it's in the major arc.
        //
        public static bool BetweenMajor(Point m, Arc originalArc)
        {
            if (originalArc.HasEndpoint(m)) return true;

            if (m == null) return false;

            // Is the point on this circle?
            if (!originalArc.theCircle.PointLiesOn(m)) return false;

            // Is it on the arc minor?
            if (BetweenMinor(m, originalArc)) return false;

            return true;
        }
Exemple #12
0
        public Point SharedEndpoint(Arc that)
        {
            if (this.endpoint1.StructurallyEquals(that.endpoint1)) return endpoint1;
            if (this.endpoint1.StructurallyEquals(that.endpoint2)) return endpoint1;

            if (this.endpoint2.StructurallyEquals(that.endpoint1)) return endpoint2;
            if (this.endpoint2.StructurallyEquals(that.endpoint2)) return endpoint2;

            return null;
        }
Exemple #13
0
 // Does this arc contain a sub-arc:
 // A-------B-------C------D
 // A subarc is: AB, AC, AD, BC, BD, CD
 public bool HasMinorSubArc(Arc arc)
 {
     return Arc.BetweenMinor(arc.endpoint1, this) && Arc.BetweenMinor(arc.endpoint2, this);
 }
        private static EdgeAggregator CreateClause(Intersection inter, GroundedClause original, Angle theAngle, Arc theArc)
        {
            Multiplication product = new Multiplication(new NumericValue(2), theAngle);
            GeometricAngleArcEquation angArcEq = new GeometricAngleArcEquation(product, theArc);

            // For hypergraph
            List<GroundedClause> antecedent = new List<GroundedClause>();
            antecedent.Add(original);
            antecedent.Add(inter);

            return new EdgeAggregator(antecedent, angArcEq, annotation);
        }
Exemple #15
0
 //
 // Is this segment proportional to the given segment in terms of the coordinatization from the UI?
 // We should not report proportional if the ratio between segments is 1
 //
 public KeyValuePair<int, int> CoordinateProportional(Arc a)
 {
     return Utilities.RationalRatio(this.length, a.length);
 }
Exemple #16
0
        //
        // Do these arcs cross each other (pseudo-X)?
        //
        public bool Crosses(Arc that)
        {
            // Need to be from different circles.
            if (this.theCircle.StructurallyEquals(that.theCircle)) return false;

            // Need to touch at a point not at the endpoints;
            if (this.HasEndpoint(that.endpoint1) && this.HasEndpoint(that.endpoint2)) return false;

            Point inter1, inter2;
            this.FindIntersection(that, out inter1, out inter2);

            if (inter1 == null && inter2 == null) return false;

            // Pseudo-X
            if (inter1 != null && inter2 == null)
            {
                return this.PointLiesStrictlyOn(inter1) && that.PointLiesStrictlyOn(inter1);
            }

            // Cursive r; an endpoint may be shared here.
            if (inter1 != null && inter2 != null)
            {
                return true;
            }

            return false;
        }
Exemple #17
0
        //
        // An arc is covered if one side of the polygon defines the endpoints of the arc.
        //
        public bool Covers(Arc that)
        {
            foreach (Segment side in orderedSides)
            {
                if (side.Covers(that)) return true;
            }

            return false;
        }
Exemple #18
0
 public override void FindIntersection(Arc that, out Point inter1, out Point inter2)
 {
     that.FindIntersection(this, out inter1, out inter2);
 }
Exemple #19
0
 public bool Covers(Arc that)
 {
     return that.HasEndpoint(this.Point1) && that.HasEndpoint(this.Point2);
 }
Exemple #20
0
        //
        // Tangent circle have 1 intersection point
        //
        public Point AreTangent(Arc thatArc)
        {
            Point intersection = this.theCircle.AreTangent(thatArc.theCircle);

            // Is the intersection between the endpoints of both arcs? Check both.
            if (Arc.BetweenMinor(intersection, this) && Arc.BetweenMinor(intersection, thatArc)) return intersection;
            if (Arc.BetweenMinor(intersection, this) && Arc.BetweenMinor(intersection, thatArc)) return intersection;

            return null;
        }
Exemple #21
0
 public abstract bool HasSubArc(Arc that);
Exemple #22
0
 //
 // Is this arc congruent to the given arc in terms of the coordinatization from the UI?
 //
 public bool CoordinateCongruent(Arc a)
 {
     return Utilities.CompareValues(this.length, a.length);
 }
Exemple #23
0
        //
        // An arc is covered if one side of the polygon defines the endpoints of the arc.
        //
        public bool Covers(Arc that)
        {
            if (radius1.Covers(that)) return true;

            if (radius2.Covers(that)) return true;

            return theArc.Covers(that);
        }
Exemple #24
0
 public bool Covers(Arc that)
 {
     return this.PointLiesStrictlyOn(that.endpoint1) || this.PointLiesStrictlyOn(that.endpoint1);
 }
Exemple #25
0
        public static ConcreteAST.Point AcquireRestrictedPoint(List <ConcreteAST.Point> points, ConcreteAST.Point that,
                                                               ConcreteAST.Segment seg, ConcreteAST.Arc arc)
        {
            ConcreteAST.Point pt = AcquirePoint(points, that);

            if (pt == null)
            {
                return(null);
            }

            return(!seg.PointLiesOnAndBetweenEndpoints(pt) || !arc.PointLiesOn(pt) ? null : pt);
        }
Exemple #26
0
        public override void FindIntersection(Arc that, out Point inter1, out Point inter2)
        {
            // Find the points of intersection
            this.theCircle.FindIntersection(that.theCircle, out inter1, out inter2);

            // The points must be on this minor arc.
            if (this is MinorArc)
            {
                if (!Arc.BetweenMinor(inter1, this)) inter1 = null;
                if (!Arc.BetweenMinor(inter2, this)) inter2 = null;
            }
            else
            {
                if (!Arc.BetweenMajor(inter1, this)) inter1 = null;
                if (!Arc.BetweenMajor(inter2, this)) inter2 = null;
            }

            // The points must be on thatArc
            if (that is MinorArc)
            {
                if (!Arc.BetweenMinor(inter1, that)) inter1 = null;
                if (!Arc.BetweenMinor(inter2, that)) inter2 = null;
            }
            else
            {
                if (!Arc.BetweenMajor(inter1, that)) inter1 = null;
                if (!Arc.BetweenMajor(inter2, that)) inter2 = null;
            }

            if (inter1 == null && inter2 != null)
            {
                inter1 = inter2;
                inter2 = null;
            }
        }
Exemple #27
0
 //
 // An arc is covered if one side of the polygon defines the endpoints of the arc.
 //
 public bool Covers(Arc that)
 {
     return this.StructurallyEquals(that.theCircle);
 }
Exemple #28
0
 public bool HasStrictMinorSubArc(Arc arc)
 {
     return Arc.StrictlyBetweenMinor(arc.endpoint1, this) && Arc.StrictlyBetweenMinor(arc.endpoint2, this);
 }
Exemple #29
0
 public bool HasArc(Arc arc)
 {
     return this.StructurallyEquals(arc.theCircle);
 }
Exemple #30
0
 //
 // Concentric
 //
 public bool IsConcentricWith(Arc thatArc)
 {
     return this.theCircle.AreConcentric(thatArc.theCircle);
 }
 public GeometricCongruentArcs(Arc c1, Arc c2)
     : base(c1, c2)
 {
 }
Exemple #32
0
 public virtual void FindIntersection(Arc that, out Point inter1, out Point inter2)
 {
     inter1 = null; inter2 = null;
 }
Exemple #33
0
 public override bool PointLiesOn(Point pt)
 {
     return(Arc.BetweenMinor(pt, new MinorArc(theCircle, endpoint1, middlePoint)) ||
            Arc.BetweenMinor(pt, new MinorArc(theCircle, endpoint2, middlePoint)));
 }