コード例 #1
0
        public static List <GenericInstantiator.EdgeAggregator> Instantiate(GroundedClause gc)
        {
            List <GenericInstantiator.EdgeAggregator> newGrounded = new List <GenericInstantiator.EdgeAggregator>();

            Segment segment = gc as Segment;

            if (segment == null)
            {
                return(newGrounded);
            }

            // Only generate reflexive if this segment is shared
            if (!segment.isShared())
            {
                return(newGrounded);
            }

            GeometricCongruentSegments ccss = new GeometricCongruentSegments(segment, segment);

            ccss.MakeIntrinsic(); // This is an 'obvious' notion so it should be intrinsic to any figure

            List <GroundedClause> antecedent = Utilities.MakeList <GroundedClause>(segment);

            newGrounded.Add(new GenericInstantiator.EdgeAggregator(antecedent, ccss, reflexAnnotation));

            return(newGrounded);
        }
コード例 #2
0
        private static List<EdgeAggregator> InstantiateTheorem(Parallelogram parallelogram, GroundedClause original)
        {
            List<EdgeAggregator> newGrounded = new List<EdgeAggregator>();

            // Determine the CongruentSegments opposing sides and output that.
            GeometricCongruentSegments gcs1 = new GeometricCongruentSegments(parallelogram.top, parallelogram.bottom);
            GeometricCongruentSegments gcs2 = new GeometricCongruentSegments(parallelogram.left, parallelogram.right);

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

            newGrounded.Add(new EdgeAggregator(antecedent, gcs1, annotation));
            newGrounded.Add(new EdgeAggregator(antecedent, gcs2, annotation));

            return newGrounded;
        }
コード例 #3
0
        //
        // All radii of a circle are congruent.
        //
        private static List<GenericInstantiator.EdgeAggregator> InstantiateFromDefinition(Circle circle)
        {
            List<EdgeAggregator> congRadii = new List<EdgeAggregator>();

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

            for (int r1 = 0; r1 < circle.radii.Count; r1++)
            {
                for (int r2 = r1 + 1; r2 < circle.radii.Count; r2++)
                {
                    GeometricCongruentSegments gcs = new GeometricCongruentSegments(circle.radii[r1], circle.radii[r2]);
                    congRadii.Add(new GenericInstantiator.EdgeAggregator(antecedent, gcs, annotation));
                }
            }

            return congRadii;
        }
コード例 #4
0
        private static List<EdgeAggregator> InstantiateToTheorem(Rectangle rectangle, GroundedClause original)
        {
            List<EdgeAggregator> newGrounded = new List<EdgeAggregator>();

            //Instantiate this rectangle ONLY if the original figure has the rectangle diagonals drawn.
            if (rectangle.diagonalIntersection == null) return newGrounded;

            // Determine the CongruentSegments opposing sides and output that.
            GeometricCongruentSegments gcs = new GeometricCongruentSegments(rectangle.topLeftBottomRightDiagonal,
                                                                            rectangle.bottomLeftTopRightDiagonal);

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

            newGrounded.Add(new EdgeAggregator(antecedent, gcs, annotation));

            return newGrounded;
        }
コード例 #5
0
        private static List<EdgeAggregator> InstantiateFromIsoscelesTrapezoid(Trapezoid trapezoid, GroundedClause original)
        {
            List<EdgeAggregator> newGrounded = new List<EdgeAggregator>();

            // Create the congruent, oppsing side segments
            GeometricCongruentSegments gcs = new GeometricCongruentSegments(trapezoid.leftLeg, trapezoid.rightLeg);

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

            newGrounded.Add(new EdgeAggregator(antecedent, gcs, annotation));

            return newGrounded;
        }
コード例 #6
0
ファイル: KiteDefinition.cs プロジェクト: wcatykid/GeoShader
        private static List<EdgeAggregator> InstantiateFromKite(Kite kite, GroundedClause original)
        {
            List<EdgeAggregator> newGrounded = new List<EdgeAggregator>();

            //
            // Determine the CongruentSegments opposing sides and output that.
            //
            GeometricCongruentSegments gcs1 = new GeometricCongruentSegments(kite.pairASegment1, kite.pairASegment2);
            GeometricCongruentSegments gcs2 = new GeometricCongruentSegments(kite.pairBSegment1, kite.pairBSegment2);

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

            newGrounded.Add(new EdgeAggregator(antecedent, gcs1, annotation));
            newGrounded.Add(new EdgeAggregator(antecedent, gcs2, annotation));

            return newGrounded;
        }
コード例 #7
0
        //                    \ A
        //                     \
        //                      \
        //   center: O          / P
        //                     /
        //                    / B
        //
        // Tangent(Circle(O), Segment(B, P)),
        // Tangent(Circle(O), Segment(A, P)),
        // Intersection(AP, BP) -> Congruent(Segment(A, P), Segment(P, B))
        //
        private static List<EdgeAggregator> InstantiateTheorem(Tangent tangent1, Tangent tangent2, Intersection inter, GroundedClause original1, GroundedClause original2)
        {
            List<EdgeAggregator> newGrounded = new List<EdgeAggregator>();

            // Do the tangents apply to the same circle?
            if (!tangent1.intersection.theCircle.StructurallyEquals(tangent2.intersection.theCircle)) return newGrounded;

            // Do the tangents have components the are part of the third intersection
            if (!inter.HasSegment((tangent1.intersection as CircleSegmentIntersection).segment)) return newGrounded;
            if (!inter.HasSegment((tangent2.intersection as CircleSegmentIntersection).segment)) return newGrounded;

            Segment segment1 = Segment.GetFigureSegment(inter.intersect, tangent1.intersection.intersect);
            Segment segment2 = Segment.GetFigureSegment(inter.intersect, tangent2.intersection.intersect);

            GeometricCongruentSegments gcs = new GeometricCongruentSegments(segment1, segment2);

            // For hypergraph
            List<GroundedClause> antecedent = new List<GroundedClause>();
            antecedent.Add(original1);
            antecedent.Add(original2);
            antecedent.Add(inter);

            newGrounded.Add(new EdgeAggregator(antecedent, gcs, annotation));

            return newGrounded;
        }
コード例 #8
0
        //               A
        //              /)
        //             /  )
        //            /    )
        // center:   O      )
        //            \    )
        //             \  )
        //              \)
        //               C
        //
        //               D
        //              /)
        //             /  )
        //            /    )
        // center:   Q      )
        //            \    )
        //             \  )
        //              \)
        //               F
        //
        // Congruent(Arc(A, C), Arc(D, F)) -> Congruent(Segment(AC), Segment(DF))
        //
        private static List<EdgeAggregator> InstantiateConversePartOfTheorem(CongruentArcs cas)
        {
            List<EdgeAggregator> newGrounded = new List<EdgeAggregator>();

            //
            // Acquire the chords for this specific pair of arcs (endpoints of arc and segment are the same).
            //
            Segment chord1 = Segment.GetFigureSegment(cas.ca1.endpoint1, cas.ca1.endpoint2);
            Segment chord2 = Segment.GetFigureSegment(cas.ca2.endpoint1, cas.ca2.endpoint2);

            if (chord1 == null || chord2 == null) return newGrounded;

            // Construct the congruence
            GeometricCongruentSegments gcss = new GeometricCongruentSegments(chord1, chord2);

            // For hypergraph
            List<GroundedClause> antecedent = new List<GroundedClause>();
            antecedent.Add(chord1);
            antecedent.Add(chord2);
            antecedent.Add(cas);

            newGrounded.Add(new EdgeAggregator(antecedent, gcss, forwardAnnotation));

            return newGrounded;
        }
        //
        // Just generate the new triangle
        //
        private static EdgeAggregator GenerateCongruentSides(Triangle tri, CongruentAngles cas)
        {
            GeometricCongruentSegments newConSegs = new GeometricCongruentSegments(tri.OtherSide(cas.ca1), tri.OtherSide(cas.ca2));

            List<GroundedClause> antecedent = new List<GroundedClause>();
            antecedent.Add(cas);
            antecedent.Add(tri);

            return new EdgeAggregator(antecedent, newConSegs, annotation);
        }
コード例 #10
0
ファイル: Segment.cs プロジェクト: wcatykid/GeoShader
        public static List<GenericInstantiator.EdgeAggregator> Instantiate(GroundedClause gc)
        {
            List<GenericInstantiator.EdgeAggregator> newGrounded = new List<GenericInstantiator.EdgeAggregator>();

            Segment segment = gc as Segment;
            if (segment == null) return newGrounded;

            // Only generate reflexive if this segment is shared
            if (!segment.isShared()) return newGrounded;

            GeometricCongruentSegments ccss = new GeometricCongruentSegments(segment, segment);
            ccss.MakeIntrinsic(); // This is an 'obvious' notion so it should be intrinsic to any figure

            List<GroundedClause> antecedent = Utilities.MakeList<GroundedClause>(segment);
            newGrounded.Add(new GenericInstantiator.EdgeAggregator(antecedent, ccss, reflexAnnotation));

            return newGrounded;
        }
コード例 #11
0
        private static List<EdgeAggregator> InstantiateDefinition(GroundedClause original, IsoscelesTriangle isoTri)
        {
            List<EdgeAggregator> newGrounded = new List<EdgeAggregator>();

            GeometricCongruentSegments gcs = new GeometricCongruentSegments(isoTri.leg1, isoTri.leg2);

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

            newGrounded.Add(new EdgeAggregator(antecedent, gcs, annotation));

            return newGrounded;
        }
コード例 #12
0
        //
        // Generate the three pairs of congruent segments.
        //
        private static List<EdgeAggregator> InstantiateFromDefinition(EquilateralTriangle tri, GroundedClause original)
        {
            List<EdgeAggregator> newGrounded = new List<EdgeAggregator>();

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

            //
            // Create the 3 sets of congruent segments.
            //
            for (int s = 0; s < tri.orderedSides.Count; s++)
            {
                GeometricCongruentSegments gcs = new GeometricCongruentSegments(tri.orderedSides[s], tri.orderedSides[(s+1) % tri.orderedSides.Count]);

                newGrounded.Add(new EdgeAggregator(antecedent, gcs, annotation));
            }

            //
            // Create the 3 congruent angles.
            //
            for (int a = 0; a < tri.angles.Count; a++)
            {
                GeometricCongruentAngles gcas = new GeometricCongruentAngles(tri.angles[a], tri.angles[(a + 1) % tri.angles.Count]);

                newGrounded.Add(new EdgeAggregator(antecedent, gcas, annotation));
            }

            //
            // Create the 3 equations for the measure of each angle being 60 degrees.
            //
            for (int a = 0; a < tri.angles.Count; a++)
            {
                GeometricAngleEquation gae = new GeometricAngleEquation(tri.angles[a], new NumericValue(60));

                newGrounded.Add(new EdgeAggregator(antecedent, gae, annotation));
            }

            return newGrounded;
        }
コード例 #13
0
        private static List<EdgeAggregator> InstantiateFromMidpoint(InMiddle im, Midpoint midpt, GroundedClause original)
        {
            List<EdgeAggregator> newGrounded = new List<EdgeAggregator>();

            // Does this ImMiddle apply to this midpoint?
            if (!im.point.StructurallyEquals(midpt.point)) return newGrounded;
            if (!im.segment.StructurallyEquals(midpt.segment)) return newGrounded;

            // For hypergraph
            List<GroundedClause> antecedent = Utilities.MakeList<GroundedClause>(original);

            // Backward: Midpoint(M, Segment(A, B)) -> InMiddle(A, M, B)
            newGrounded.Add(new EdgeAggregator(antecedent, im, annotation));

            //
            // Forward: Midpoint(M, Segment(A, B)) -> Congruent(Segment(A,M), Segment(M,B))
            //
            Segment left = new Segment(midpt.segment.Point1, midpt.point);
            Segment right = new Segment(midpt.point, midpt.segment.Point2);
            GeometricCongruentSegments ccss = new GeometricCongruentSegments(left, right);
            newGrounded.Add(new EdgeAggregator(antecedent, ccss, annotation));

            return newGrounded;
        }