// Does this angle lie between the two lines? This is mainly for a parallelism check public bool OnInteriorOf(Intersection inter1, Intersection inter2) { Intersection angleBelongs = null; Intersection angleDoesNotBelong = null; // Determine the intersection to which the angle belongs if (inter1.InducesNonStraightAngle(this)) { angleBelongs = inter1; angleDoesNotBelong = inter2; } else if (inter2.InducesNonStraightAngle(this)) { angleBelongs = inter2; angleDoesNotBelong = inter1; } if (angleBelongs == null || angleDoesNotBelong == null) { return(false); } // Make the transversal out of the points of intersection Segment transversal = new Segment(angleBelongs.intersect, angleDoesNotBelong.intersect); Segment angleRayOnTraversal = this.ray1.IsCollinearWith(transversal) ? ray1 : ray2; // Is the endpoint of the angle (on the transversal) between the two intersection points? // Or, is that same endpoint on the far end beyond the other line: the other intersection point lies between the other points return(Segment.Between(angleRayOnTraversal.OtherPoint(this.GetVertex()), angleBelongs.intersect, angleDoesNotBelong.intersect) || Segment.Between(angleDoesNotBelong.intersect, angleBelongs.intersect, angleRayOnTraversal.OtherPoint(this.GetVertex()))); }
// Does this angle lie between the two lines? This is mainly for a parallelism check public bool OnInteriorOf(Intersection inter1, Intersection inter2) { Intersection angleBelongs = null; Intersection angleDoesNotBelong = null; // Determine the intersection to which the angle belongs if (inter1.InducesNonStraightAngle(this)) { angleBelongs = inter1; angleDoesNotBelong = inter2; } else if (inter2.InducesNonStraightAngle(this)) { angleBelongs = inter2; angleDoesNotBelong = inter1; } if (angleBelongs == null || angleDoesNotBelong == null) return false; // Make the transversal out of the points of intersection Segment transversal = new Segment(angleBelongs.intersect, angleDoesNotBelong.intersect); Segment angleRayOnTraversal = this.ray1.IsCollinearWith(transversal) ? ray1 : ray2; // Is the endpoint of the angle (on the transversal) between the two intersection points? // Or, is that same endpoint on the far end beyond the other line: the other intersection point lies between the other points return Segment.Between(angleRayOnTraversal.OtherPoint(this.GetVertex()), angleBelongs.intersect, angleDoesNotBelong.intersect) || Segment.Between(angleDoesNotBelong.intersect, angleBelongs.intersect, angleRayOnTraversal.OtherPoint(this.GetVertex())); }
private static List<EdgeAggregator> InstantiateToPerpendicular(Intersection inter, RightAngle ra, GroundedClause original) { List<EdgeAggregator> newGrounded = new List<EdgeAggregator>(); // This angle must apply to this intersection (same vertex as well as the segments inducing this angle) if (!inter.InducesNonStraightAngle(ra)) return newGrounded; // We are strengthening an intersection to a perpendicular 'labeling' Strengthened streng = new Strengthened(inter, new Perpendicular(inter)); List<GroundedClause> antecedent = new List<GroundedClause>(); antecedent.Add(original); antecedent.Add(inter); newGrounded.Add(new EdgeAggregator(antecedent, streng, annotation)); return newGrounded; }