// // Creates a Topped F-Shape // top // oppSide __________ <--- Stands on // | // |_____ off <--- Stands on // | // | // bottom // // Returns: <bottom, off> private static List<EdgeAggregator> GenerateToppedFShape(Parallel parallel, Intersection inter1, Intersection inter2, Intersection bottom, Point off) { List<EdgeAggregator> newGrounded = new List<EdgeAggregator>(); Intersection top = inter1.Equals(bottom) ? inter2 : inter1; // Determine the side of the top intersection needed for the angle Segment transversal = inter1.AcquireTransversal(inter2); Segment parallelTop = top.OtherSegment(transversal); Segment parallelBottom = bottom.OtherSegment(transversal); Segment crossingTester = new Segment(off, parallelTop.Point1); Point intersection = transversal.FindIntersection(crossingTester); Point oppSide = transversal.PointLiesOnAndBetweenEndpoints(intersection) ? parallelTop.Point1 : parallelTop.Point2; // // Generate the new congruence // List<CongruentAngles> newAngleRelations = new List<CongruentAngles>(); GeometricCongruentAngles gca = new GeometricCongruentAngles(new Angle(off, bottom.intersect, top.intersect), new Angle(oppSide, top.intersect, bottom.intersect)); newAngleRelations.Add(gca); return MakeRelations(newAngleRelations, parallel, inter1, inter2); }
// // Creates a shape like a crazy person flying // // top top // | | // larger |_____|___ off // | | // | | // // Similar to H-shape with an extended point // Returns the 'larger' intersection that contains the point: off private static List<EdgeAggregator> InstantiateFlyingIntersection(Parallel parallel, Intersection inter1, Intersection inter2, Intersection larger, Point off) { List<EdgeAggregator> newGrounded = new List<EdgeAggregator>(); Intersection smallerInter = inter1.Equals(larger) ? inter2 : inter1; Segment transversal = inter1.AcquireTransversal(inter2); Segment parallel1 = inter1.OtherSegment(transversal); Segment parallel2 = inter2.OtherSegment(transversal); Point largerTop = parallel1.Point1; Point largerBottom = parallel1.Point2; Point otherTop = null; Point otherBottom = null; Segment crossingTester = new Segment(parallel1.Point1, parallel2.Point1); Point intersection = transversal.FindIntersection(crossingTester); // opposite sides if (transversal.PointLiesOnAndBetweenEndpoints(intersection)) { otherTop = parallel2.Point2; otherBottom = parallel2.Point1; } // same sides else { otherTop = parallel2.Point1; otherBottom = parallel2.Point2; } // // Generate the new congruence // List<CongruentAngles> newAngleRelations = new List<CongruentAngles>(); GeometricCongruentAngles gca1 = new GeometricCongruentAngles(new Angle(off, smallerInter.intersect, otherTop), new Angle(smallerInter.intersect, larger.intersect, largerTop)); newAngleRelations.Add(gca1); GeometricCongruentAngles gca2 = new GeometricCongruentAngles(new Angle(off, smallerInter.intersect, otherBottom), new Angle(smallerInter.intersect, larger.intersect, largerBottom)); newAngleRelations.Add(gca2); return MakeRelations(newAngleRelations, parallel, inter1, inter2); }