public static List <EdgeAggregator> InstantiateRight(RightTriangle rt, Altitude altitude, GroundedClause original) { List <EdgeAggregator> newGrounded = new List <EdgeAggregator>(); // The altitude must connect the vertex defining the right angle and the opposite side. if (!altitude.segment.HasPoint(rt.rightAngle.GetVertex())) { return(newGrounded); } // The other point of the altitude must lie on the opposite side of the triangle Point altPointOppRightAngle = altitude.segment.OtherPoint(rt.rightAngle.GetVertex()); Segment oppositeSide = rt.GetOppositeSide(rt.rightAngle); if (!Segment.Between(altPointOppRightAngle, oppositeSide.Point1, oppositeSide.Point2)) { return(newGrounded); } // // Find the two smaller right triangles in the candidate list (which should be in the list at this point) // RightTriangle first = null; RightTriangle second = null; foreach (RightTriangle smallerRT in candRightTriangles) { if (smallerRT.IsDefinedBy(rt, altitude)) { if (first == null) { first = smallerRT; } else { second = smallerRT; break; } } } // CTA: We did not check to see points aligned, but these are the original triangles from the figure GeometricSimilarTriangles gsts1 = new GeometricSimilarTriangles(rt, first); GeometricSimilarTriangles gsts2 = new GeometricSimilarTriangles(rt, second); GeometricSimilarTriangles gsts3 = new GeometricSimilarTriangles(first, second); List <GroundedClause> antecedent = new List <GroundedClause>(); antecedent.Add(original); antecedent.Add(altitude); newGrounded.Add(new EdgeAggregator(antecedent, gsts1, annotation)); newGrounded.Add(new EdgeAggregator(antecedent, gsts2, annotation)); newGrounded.Add(new EdgeAggregator(antecedent, gsts3, annotation)); return(newGrounded); }