public Arc OtherArc(Arc thatArc) { if (ca1.StructurallyEquals(thatArc)) return ca2; if (ca2.StructurallyEquals(thatArc)) return ca1; return null; }
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; }
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); }
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); }
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); }
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); } }
// // 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; }
public static bool StrictlyBetweenMinor(Point m, Arc originalArc) { if (m == null) return false; if (originalArc.HasEndpoint(m)) return false; return BetweenMinor(m, originalArc); }
// // 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); }
// // 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; }
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; }
// 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); }
// // 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); }
// // 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; }
// // 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; }
public override void FindIntersection(Arc that, out Point inter1, out Point inter2) { that.FindIntersection(this, out inter1, out inter2); }
public bool Covers(Arc that) { return that.HasEndpoint(this.Point1) && that.HasEndpoint(this.Point2); }
// // 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; }
public abstract bool HasSubArc(Arc that);
// // 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); }
// // 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); }
public bool Covers(Arc that) { return this.PointLiesStrictlyOn(that.endpoint1) || this.PointLiesStrictlyOn(that.endpoint1); }
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); }
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; } }
// // 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); }
public bool HasStrictMinorSubArc(Arc arc) { return Arc.StrictlyBetweenMinor(arc.endpoint1, this) && Arc.StrictlyBetweenMinor(arc.endpoint2, this); }
public bool HasArc(Arc arc) { return this.StructurallyEquals(arc.theCircle); }
// // Concentric // public bool IsConcentricWith(Arc thatArc) { return this.theCircle.AreConcentric(thatArc.theCircle); }
public GeometricCongruentArcs(Arc c1, Arc c2) : base(c1, c2) { }
public virtual void FindIntersection(Arc that, out Point inter1, out Point inter2) { inter1 = null; inter2 = null; }
public override bool PointLiesOn(Point pt) { return(Arc.BetweenMinor(pt, new MinorArc(theCircle, endpoint1, middlePoint)) || Arc.BetweenMinor(pt, new MinorArc(theCircle, endpoint2, middlePoint))); }