Exemplo n.º 1
0
        public static new List<FigSynthProblem> SubtractShape(Figure outerShape, List<Connection> conns, List<Point> points)
        {
            // Possible quadrilaterals.
            List<Quadrilateral> quads = null;

            if (outerShape is ConcavePolygon) quads = Quadrilateral.GetQuadrilateralsFromPoints(outerShape as ConcavePolygon, points);
            else quads = Quadrilateral.GetQuadrilateralsFromPoints(points);

            List<FigSynthProblem> composed = new List<FigSynthProblem>();
            foreach (Quadrilateral quad in quads)
            {
                // Select only isosceles trapezoids that don't match the outer shape.
                if (quad.VerifyIsoscelesTrapezoid() && !quad.HasSamePoints(outerShape as Polygon))
                {
                    IsoscelesTrapezoid isoTrap = new IsoscelesTrapezoid(quad);

                    SubtractionSynth subSynth = new SubtractionSynth(outerShape, isoTrap);
                    subSynth.SetOpenRegions(FigSynthProblem.AcquireOpenAtomicRegions(conns, isoTrap.points, isoTrap));

                    composed.Add(subSynth);
                }
            }

            return FigSynthProblem.RemoveSymmetric(composed);
        }
        private static List<EdgeAggregator> InstantiateToTheorem(IsoscelesTrapezoid trapezoid, GroundedClause original)
        {
            List<EdgeAggregator> newGrounded = new List<EdgeAggregator>();

            GeometricCongruentAngles gcas1 = new GeometricCongruentAngles(trapezoid.bottomLeftBaseAngle, trapezoid.bottomRightBaseAngle);
            GeometricCongruentAngles gcas2 = new GeometricCongruentAngles(trapezoid.topLeftBaseAngle, trapezoid.topRightBaseAngle);

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

            newGrounded.Add(new EdgeAggregator(antecedent, gcas1, annotation));
            newGrounded.Add(new EdgeAggregator(antecedent, gcas2, annotation));

            return newGrounded;
        }
Exemplo n.º 3
0
 //
 // An isosceles trapezoid can use an equation to find the height based on the bases and the side lengths.
 //
 public static void HandleIsoscelesTrapezoid(KnownMeasurementsAggregator known, IsoscelesTrapezoid isoTrap)
 {
     isoTrap.CalculateHeight(known);
 }