Пример #1
0
        //Demonstrates: Tangents are perpendicular to radii

        public Page296Theorem7_1(bool onoff, bool complete)
            : base(onoff, complete)
        {
            Point o = new Point("O", 0, 0); points.Add(o);
            Point r = new Point("R", -3, -5); points.Add(r);
            Point s = new Point("S", 8, -5); points.Add(s);
            Point t = new Point("T", 0, -5); points.Add(t);

            Segment ot = new Segment(o, t); segments.Add(ot);

            List <Point> pnts = new List <Point>();

            pnts.Add(r);
            pnts.Add(t);
            pnts.Add(s);
            collinear.Add(new Collinear(pnts));

            Circle c = new Circle(o, 5.0);

            circles.Add(c);

            parser = new LiveGeometry.TutorParser.HardCodedParserMain(points, collinear, segments, circles, onoff);

            Segment rs = (Segment)parser.Get(new Segment(r, s));

            CircleSegmentIntersection cInter = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(t, c, rs));

            given.Add(new Strengthened(cInter, new Tangent(cInter)));

            Intersection inter = parser.GetIntersection(ot, rs);

            goals.Add(new Strengthened(inter, new Perpendicular(inter)));
        }
        //
        //    A \ 
        //       \    B
        //        \  /
        //  O      \/ X
        //         /\
        //        /  \
        //     C /    D
        //
        // Two tangents:
        // Intersection(X, AD, BC), Tangent(Circle(O), BC), Tangent(Circle(O), AD) -> 2 * Angle(AXC) = MajorArc(AC) - MinorArc(AC)
        //
        public static List <EdgeAggregator> InstantiateTwoTangentsTheorem(Tangent tangent1, Tangent tangent2, Intersection inter, GroundedClause original1, GroundedClause original2)
        {
            List <EdgeAggregator> newGrounded = new List <EdgeAggregator>();

            CircleSegmentIntersection tan1 = tangent1.intersection as CircleSegmentIntersection;
            CircleSegmentIntersection tan2 = tangent2.intersection as CircleSegmentIntersection;

            if (tan1.StructurallyEquals(tan2))
            {
                return(newGrounded);
            }

            // Do the tangents apply to the same circle?
            if (!tan1.theCircle.StructurallyEquals(tan2.theCircle))
            {
                return(newGrounded);
            }

            Circle circle = tan1.theCircle;

            // Do these tangents work with this intersection?
            if (!inter.HasSegment(tan1.segment) || !inter.HasSegment(tan2.segment))
            {
                return(newGrounded);
            }

            // Overkill? Do the tangents intersect at the same point as the intersection's intersect point?
            if (!tan1.segment.FindIntersection(tan2.segment).StructurallyEquals(inter.intersect))
            {
                return(newGrounded);
            }

            //
            // Get the arcs
            //
            Arc minorArc = new MinorArc(circle, tan1.intersect, tan2.intersect);
            Arc majorArc = new MajorArc(circle, tan1.intersect, tan2.intersect);

            Angle theAngle = new Angle(tan1.intersect, inter.intersect, tan2.intersect);

            //
            // Construct the new relationship
            //
            NumericValue two = new NumericValue(2);

            GeometricAngleArcEquation gaaeq = new GeometricAngleArcEquation(new Multiplication(two, theAngle), new Subtraction(majorArc, minorArc));

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

            antecedent.Add(original1);
            antecedent.Add(original2);
            antecedent.Add(inter);
            antecedent.Add(majorArc);
            antecedent.Add(minorArc);

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

            return(newGrounded);
        }
Пример #3
0
        public TvPage1Prob6(bool onoff, bool complete)
            : base(onoff, complete)
        {
            Point a = new Point("A", 0, 0); points.Add(a);
            Point b = new Point("B", 0, 8); points.Add(b);
            Point c = new Point("C", 10, 8); points.Add(c);
            Point d = new Point("D", 10, 0); points.Add(d);
            Point o = new Point("O", 0, 2); points.Add(o);
            Point p = new Point("P", 10, 4); points.Add(p);
            Point q = new Point("Q", 0, 4); points.Add(q);

            Segment bc = new Segment(b, c); segments.Add(bc);
            Segment da = new Segment(d, a); segments.Add(da);

            List <Point> pnts = new List <Point>();

            pnts.Add(b);
            pnts.Add(q);
            pnts.Add(o);
            pnts.Add(a);
            collinear.Add(new Collinear(pnts));

            pnts = new List <Point>();
            pnts.Add(c);
            pnts.Add(p);
            pnts.Add(d);
            collinear.Add(new Collinear(pnts));

            Circle small = new Circle(o, 2);
            Circle big   = new Circle(p, 4);

            circles.Add(small);
            circles.Add(big);

            parser = new GeometryTutorLib.TutorParser.HardCodedParserMain(points, collinear, segments, circles, onoff);

            CircleSegmentIntersection cInter1 = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(c, big, bc));
            CircleSegmentIntersection cInter2 = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(d, big, da));
            CircleSegmentIntersection cInter3 = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(a, small, da));

            given.Add(new Strengthened(cInter1, new Tangent(cInter1)));
            given.Add(new Strengthened(cInter2, new Tangent(cInter2)));
            given.Add(new Strengthened(cInter3, new Tangent(cInter3)));

            known.AddSegmentLength((Segment)parser.Get(new Segment(b, q)), 4);
            known.AddSegmentLength((Segment)parser.Get(new Segment(c, d)), 8);
            known.AddSegmentLength(bc, 10);

            List <Point> unwanted = new List <Point>();

            unwanted.Add(new Point("", -0.5, 2));
            unwanted.Add(new Point("", 0.5, 2));
            goalRegions = parser.implied.GetAllAtomicRegionsWithoutPoints(unwanted);

            SetSolutionArea(80 + 6 * System.Math.PI);

            problemName = "Tutor Vista Page 1 Problem 6";
            GeometryTutorLib.EngineUIBridge.HardCodedProblemsToUI.AddProblem(problemName, points, circles, segments);
        }
Пример #4
0
        public Page64(bool onoff, bool complete)
            : base(onoff, complete)
        {
            Point a = new Point("A", 0, 0); points.Add(a);
            Point b = new Point("B", 6, 4); points.Add(b);
            Point c = new Point("C", 14, 4); points.Add(c);
            Point d = new Point("D", 20, 0); points.Add(d);
            Point o = new Point("O", 10, 4); points.Add(o);
            Point p = new Point("P", 10, 0); points.Add(p);

            Segment ab = new Segment(a, b); segments.Add(ab);
            Segment cd = new Segment(c, d); segments.Add(cd);
            Segment op = new Segment(o, p); segments.Add(op);

            List <Point> pnts = new List <Point>();

            pnts.Add(b);
            pnts.Add(o);
            pnts.Add(c);
            collinear.Add(new Collinear(pnts));

            pnts = new List <Point>();
            pnts.Add(a);
            pnts.Add(p);
            pnts.Add(d);
            collinear.Add(new Collinear(pnts));

            Circle circle = new Circle(o, 4);

            circles.Add(circle);

            parser = new GeometryTutorLib.TutorParser.HardCodedParserMain(points, collinear, segments, circles, onoff);

            Segment ad = (Segment)parser.Get(new Segment(a, d));
            Angle   a1 = (Angle)parser.Get(new Angle(b, o, p));
            CircleSegmentIntersection cInter1 = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(p, circle, ad));

            given.Add(new Strengthened(a1, new RightAngle(a1)));
            given.Add(new Strengthened(cInter1, new Tangent(cInter1)));

            known.AddSegmentLength(ad, 20);
            known.AddSegmentLength((Segment)parser.Get(new Segment(b, c)), 8);

            List <Point> wanted = new List <Point>();

            wanted.Add(new Point("", 5, 1));
            wanted.Add(new Point("", 15, 1));
            goalRegions = parser.implied.GetAtomicRegionsByPoints(wanted);

            SetSolutionArea(56 - 8 * System.Math.PI);

            problemName = "Collected Learning Page 64";
            GeometryTutorLib.EngineUIBridge.HardCodedProblemsToUI.AddProblem(problemName, points, circles, segments);
        }
        //        )  | B
        //         ) |
        // O        )| S
        //         ) |
        //        )  |
        //       )   | A
        // Tangent(Circle(O, R), Segment(A, B)), Intersection(OS, AB) -> Perpendicular(Segment(A,B), Segment(O, S))
        //
        public static List <EdgeAggregator> Instantiate(GroundedClause clause)
        {
            annotation.active = EngineUIBridge.JustificationSwitch.PERPENDICULAR_TO_RADIUS_IS_TANGENT;

            List <EdgeAggregator> newGrounded = new List <EdgeAggregator>();

            if (clause is CircleSegmentIntersection)
            {
                CircleSegmentIntersection newInter = clause as CircleSegmentIntersection;

                foreach (Perpendicular oldPerp in candidatePerpendicular)
                {
                    newGrounded.AddRange(InstantiateTheorem(newInter, oldPerp, oldPerp));
                }

                foreach (Strengthened oldStreng in candidateStrengthened)
                {
                    newGrounded.AddRange(InstantiateTheorem(newInter, oldStreng.strengthened as Perpendicular, oldStreng));
                }

                candidateIntersections.Add(newInter);
            }
            else if (clause is Perpendicular)
            {
                Perpendicular newPerp = clause as Perpendicular;

                foreach (CircleSegmentIntersection oldInter in candidateIntersections)
                {
                    newGrounded.AddRange(InstantiateTheorem(oldInter, newPerp, newPerp));
                }

                candidatePerpendicular.Add(newPerp);
            }
            else if (clause is Strengthened)
            {
                Strengthened newStreng = clause as Strengthened;

                if (!(newStreng.strengthened is Perpendicular))
                {
                    return(newGrounded);
                }

                foreach (CircleSegmentIntersection oldInter in candidateIntersections)
                {
                    newGrounded.AddRange(InstantiateTheorem(oldInter, newStreng.strengthened as Perpendicular, newStreng));
                }

                candidateStrengthened.Add(newStreng);
            }

            return(newGrounded);
        }
        //        )  | B
        //         ) |
        // O        )| S
        //         ) |
        //        )  |
        //       )   | A
        // Tangent(Circle(O, R), Segment(A, B)), Intersection(OS, AB) -> Perpendicular(Segment(A,B), Segment(O, S))
        //
        private static List <EdgeAggregator> InstantiateTheorem(CircleSegmentIntersection inter, Perpendicular perp, GroundedClause original)
        {
            List <EdgeAggregator> newGrounded = new List <EdgeAggregator>();

            // The intersection points must be the same.
            if (!inter.intersect.StructurallyEquals(perp.intersect))
            {
                return(newGrounded);
            }

            // Get the radius - if it exists
            Segment radius  = null;
            Segment garbage = null;

            inter.GetRadii(out radius, out garbage);

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

            // Two intersections, not a tangent situation.
            if (garbage != null)
            {
                return(newGrounded);
            }

            // The radius can't be the same as the Circ-Inter segment.
            if (inter.segment.HasSubSegment(radius))
            {
                return(newGrounded);
            }

            // Does this perpendicular apply to this Arc intersection?
            if (!perp.HasSegment(radius) || !perp.HasSegment(inter.segment))
            {
                return(newGrounded);
            }

            Strengthened newTangent = new Strengthened(inter, new Tangent(inter));

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

            antecedent.Add(original);
            antecedent.Add(inter);

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

            return(newGrounded);
        }
Пример #7
0
        public Page10Prob36(bool onoff, bool complete) : base(onoff, complete)
        {
            Point a = new Point("A", 0, 0); points.Add(a);
            Point b = new Point("B", 0, 9); points.Add(b);
            Point c = new Point("C", 8, 9); points.Add(c);
            Point d = new Point("D", 12, 9); points.Add(d);
            Point e = new Point("E", 12, 0); points.Add(e);

            Segment ab = new Segment(a, b); segments.Add(ab);
            Segment cd = new Segment(c, d); segments.Add(cd);
            Segment de = new Segment(d, e); segments.Add(de);
            Segment ea = new Segment(e, a); segments.Add(ea);

            Point x = new Point("X", 4, 9.0); points.Add(x);

            circles.Add(new Circle(x, 4.0));

            List <Point> pts = new List <Point>();

            pts.Add(b);
            pts.Add(x);
            pts.Add(c);
            pts.Add(d);
            collinear.Add(new Collinear(pts));

            parser = new TutorParser.HardCodedParserMain(points, collinear, segments, circles, onoff);

            CircleSegmentIntersection csi = new CircleSegmentIntersection(b, circles[0], ab);

            given.Add(new Tangent((CircleSegmentIntersection)parser.Get(csi)));
            given.Add(new RightAngle((Angle)parser.Get(new Angle(b, a, e))));
            given.Add(new GeometricCongruentSegments((Segment)parser.Get(new Segment(b, d)), ea));

            known.AddSegmentLength(ab, 9);
            known.AddSegmentLength(cd, 4);
            known.AddSegmentLength(ea, 12);

            List <Point> wanted = new List <Point>();

            wanted.Add(new Point("", 10, 1));
            goalRegions = parser.implied.GetAtomicRegionsByPoints(wanted);

            SetSolutionArea(108 - 16 * System.Math.PI / 2.0);

            problemName = "Glencoe Page 10 Problem 36";
            GeometryTutorLib.EngineUIBridge.HardCodedProblemsToUI.AddProblem(problemName, points, circles, segments);
        }
        //        )  | B
        //         ) |
        // O        )| S
        //         ) |
        //        )  |
        //       )   | A
        // Tangent(Circle(O, R), Segment(A, B)), Intersection(OS, AB) -> Perpendicular(Segment(A,B), Segment(O, S))
        //
        private static List <EdgeAggregator> InstantiateTheorem(Tangent tangent, Intersection inter, GroundedClause original)
        {
            List <EdgeAggregator> newGrounded = new List <EdgeAggregator>();

            CircleSegmentIntersection tanInter = tangent.intersection as CircleSegmentIntersection;

            // Does this tangent segment apply to this intersection?
            if (!inter.HasSegment(tanInter.segment))
            {
                return(newGrounded);
            }

            // Get the radius--if it exists
            Segment radius  = null;
            Segment garbage = null;

            tanInter.GetRadii(out radius, out garbage);

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

            // Does this radius apply to this intersection?
            if (!inter.HasSubSegment(radius))
            {
                return(newGrounded);
            }

            Strengthened newPerp = new Strengthened(inter, new Perpendicular(inter));

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

            antecedent.Add(original);
            antecedent.Add(inter);

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

            return(newGrounded);
        }
Пример #9
0
        //Demonstrates: Tangents are perpendicular to radii

        public Page296Theorem7_1_Test2(bool onoff, bool complete) : base(onoff, complete)
        {
            Point o = new Point("O", 0, 0); points.Add(o);
            Point a = new Point("A", 3, 4); points.Add(a);
            Point p = new Point("P", 0, 6.25); points.Add(p);

            Segment ap = new Segment(a, p); segments.Add(ap);
            Segment ao = new Segment(a, o); segments.Add(ao);

            Circle circle = new Circle(o, 5.0);

            circles.Add(circle);

            parser = new GeometryTutorLib.TutorParser.HardCodedParserMain(points, collinear, segments, circles, onoff);

            CircleSegmentIntersection cInter = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(a, circle, ap));

            given.Add(new Strengthened(cInter, new Tangent(cInter)));

            Intersection inter = parser.GetIntersection(ao, ap);

            goals.Add(new Strengthened(inter, new Perpendicular(inter)));
        }
Пример #10
0
        //Demonstrates: ChordTangentAngleHalfInterceptedArc

        public Test02(bool onoff, bool complete)
            : base(onoff, complete)
        {
            Point o = new Point("O", 0, 0); points.Add(o);
            Point r = new Point("R", -3, -5); points.Add(r);
            Point s = new Point("S", 8, -5); points.Add(s);
            Point t = new Point("T", 0, -5); points.Add(t);
            Point u = new Point("U", -3, 4); points.Add(u);
            Point v = new Point("V", 3, 4); points.Add(v);

            Segment tu = new Segment(t, u); segments.Add(tu);
            Segment tv = new Segment(t, v); segments.Add(tv);

            List <Point> pnts = new List <Point>();

            pnts.Add(r);
            pnts.Add(t);
            pnts.Add(s);
            collinear.Add(new Collinear(pnts));

            Circle c = new Circle(o, 5.0);

            circles.Add(c);

            parser = new GeometryTutorLib.TutorParser.HardCodedParserMain(points, collinear, segments, circles, onoff);

            MinorArc m1 = (MinorArc)parser.Get(new MinorArc(c, t, u));
            MinorArc m2 = (MinorArc)parser.Get(new MinorArc(c, t, v));
            Segment  rs = (Segment)parser.Get(new Segment(r, s));

            CircleSegmentIntersection cInter = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(t, c, rs));

            given.Add(new Strengthened(cInter, new Tangent(cInter)));
            given.Add(new GeometricCongruentAngles((Angle)parser.Get(new Angle(r, t, u)), (Angle)parser.Get(new Angle(s, t, v))));

            goals.Add(new GeometricCongruentArcs(m1, m2));
        }
Пример #11
0
        public HbPage2Prob4(bool onoff, bool complete)
            : base(onoff, complete)
        {
            Point a = new Point("A", 0, 0); points.Add(a);
            Point b = new Point("B", 0, 10); points.Add(b);
            Point c = new Point("C", 10, 10); points.Add(c);
            Point d = new Point("D", 10, 0); points.Add(d);
            Point o = new Point("O", 5, 5); points.Add(o);
            Point e = new Point("E", 0, 5); points.Add(e);
            Point f = new Point("F", 10, 5); points.Add(f);

            //Segment ab = new Segment(a, b); segments.Add(ab);
            Segment bc = new Segment(b, c); segments.Add(bc);
            //Segment cd = new Segment(c, d); segments.Add(cd);
            Segment da = new Segment(d, a); segments.Add(da);

            List <Point> pnts = new List <Point>();

            pnts.Add(b);
            pnts.Add(o);
            pnts.Add(d);
            collinear.Add(new Collinear(pnts));

            pnts = new List <Point>();
            pnts.Add(a);
            pnts.Add(o);
            pnts.Add(c);
            collinear.Add(new Collinear(pnts));

            pnts = new List <Point>();
            pnts.Add(a);
            pnts.Add(e);
            pnts.Add(b);
            collinear.Add(new Collinear(pnts));

            pnts = new List <Point>();
            pnts.Add(c);
            pnts.Add(f);
            pnts.Add(d);
            collinear.Add(new Collinear(pnts));

            Circle circle = new Circle(o, 5);

            circles.Add(circle);

            parser = new GeometryTutorLib.TutorParser.HardCodedParserMain(points, collinear, segments, circles, onoff);

            Segment ab = (Segment)parser.Get(new Segment(a, b));
            Segment cd = (Segment)parser.Get(new Segment(c, d));
            Angle   a1 = (Angle)parser.Get(new Angle(b, c, d));
            CircleSegmentIntersection cInter1 = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(e, circle, ab));
            CircleSegmentIntersection cInter2 = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(f, circle, cd));

            given.Add(new GeometricCongruentSegments(ab, bc));
            given.Add(new GeometricCongruentSegments(ab, cd));
            given.Add(new GeometricCongruentSegments(ab, da));
            given.Add(new Strengthened(a1, new RightAngle(a1)));
            given.Add(new Strengthened(cInter1, new Tangent(cInter1)));
            given.Add(new Strengthened(cInter2, new Tangent(cInter2)));

            known.AddSegmentLength(ab, 10);

            List <Point> wanted = new List <Point>();

            wanted.Add(new Point("", 2, 9));
            wanted.Add(new Point("", 8, 9));
            wanted.Add(new Point("", 2, 1));
            wanted.Add(new Point("", 8, 1));
            goalRegions = parser.implied.GetAtomicRegionsByPoints(wanted);

            SetSolutionArea(50 - 12.5 * System.Math.PI);

            problemName = "Hatboro Page 2 Problem 4";
            GeometryTutorLib.EngineUIBridge.HardCodedProblemsToUI.AddProblem(problemName, points, circles, segments);
        }
Пример #12
0
        public Page5Row5Prob17(bool onoff, bool complete) : base(onoff, complete)
        {
            Point a = new Point("A", 0, 0); points.Add(a);
            Point b = new Point("B", 0, 6); points.Add(b);
            Point c = new Point("C", 6, 6); points.Add(c);
            Point d = new Point("D", 6, 0); points.Add(d);

            Segment bc = new Segment(b, c); segments.Add(bc);
            Segment da = new Segment(d, a); segments.Add(da);

            Point x = new Point("X", 0, 3.0); points.Add(x);
            Point y = new Point("Y", 6, 3.0); points.Add(y);

            List <Point> pts = new List <Point>();

            pts.Add(a);
            pts.Add(x);
            pts.Add(b);
            collinear.Add(new Collinear(pts));

            pts = new List <Point>();
            pts.Add(c);
            pts.Add(y);
            pts.Add(d);
            collinear.Add(new Collinear(pts));

            Circle circleX = new Circle(x, 3.0);
            Circle circleY = new Circle(y, 3.0);

            circles.Add(circleX);
            circles.Add(circleY);

            parser = new GeometryTutorLib.TutorParser.HardCodedParserMain(points, collinear, segments, circles, onoff);


            CircleSegmentIntersection cInter1 = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(b, circleX, bc));
            CircleSegmentIntersection cInter2 = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(c, circleY, bc));
            CircleSegmentIntersection cInter3 = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(a, circleX, da));
            CircleSegmentIntersection cInter4 = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(d, circleY, da));

            given.Add(new GeometricCongruentSegments(da, (Segment)parser.Get(new Segment(a, b))));
            given.Add(new GeometricCongruentSegments(da, (Segment)parser.Get(new Segment(c, d))));
            given.Add(new Strengthened(cInter1, new Tangent(cInter1)));
            given.Add(new Strengthened(cInter2, new Tangent(cInter2)));
            given.Add(new Strengthened(cInter3, new Tangent(cInter3)));
            given.Add(new Strengthened(cInter4, new Tangent(cInter4)));

            known.AddSegmentLength(da, 6);
            known.AddSegmentLength((Segment)parser.Get(new Segment(a, b)), 6);
            known.AddSegmentLength((Segment)parser.Get(new Segment(c, d)), 6);

            List <Point> wanted = new List <Point>();

            wanted.Add(new Point("", 3, .5));
            wanted.Add(new Point("", 3, 5.5));
            goalRegions = parser.implied.GetAtomicRegionsByPoints(wanted);

            SetSolutionArea(36 - System.Math.PI * 3 * 3);

            problemName = "Jurgensen Page 5 Problem 17";
            GeometryTutorLib.EngineUIBridge.HardCodedProblemsToUI.AddProblem(problemName, points, circles, segments);
        }
Пример #13
0
        public Page5Row5Prob18(bool onoff, bool complete)
            : base(onoff, complete)
        {
            Point a = new Point("A", 0, 0); points.Add(a);
            Point b = new Point("B", 0, 4); points.Add(b);
            Point c = new Point("C", 0, 8); points.Add(c);
            Point d = new Point("D", 20, 8); points.Add(d);
            Point e = new Point("E", 18, 4); points.Add(e);
            Point f = new Point("F", 16, 0); points.Add(f);
            Point g = new Point("G", 16, 8); points.Add(g);
            Point x = new Point("X", 8, 4); points.Add(x);
            Point y = new Point("Y", 8, 0); points.Add(y);

            Segment xy = new Segment(x, y); segments.Add(xy);
            Segment fg = new Segment(f, g); segments.Add(fg);

            Circle circle = new Circle(x, 4.0);

            circles.Add(circle);

            List <Point> pts = new List <Point>();

            pts.Add(a);
            pts.Add(b);
            pts.Add(c);
            collinear.Add(new Collinear(pts));

            pts = new List <Point>();
            pts.Add(c);
            pts.Add(g);
            pts.Add(d);
            collinear.Add(new Collinear(pts));

            pts = new List <Point>();
            pts.Add(d);
            pts.Add(e);
            pts.Add(f);
            collinear.Add(new Collinear(pts));

            pts = new List <Point>();
            pts.Add(b);
            pts.Add(x);
            pts.Add(e);
            collinear.Add(new Collinear(pts));

            pts = new List <Point>();
            pts.Add(a);
            pts.Add(y);
            pts.Add(f);
            collinear.Add(new Collinear(pts));

            parser = new GeometryTutorLib.TutorParser.HardCodedParserMain(points, collinear, segments, circles, onoff);

            Angle    angle = (Angle)parser.Get(new Angle(a, c, d));
            Triangle tri   = (Triangle)parser.Get(new Triangle(f, g, d));
            CircleSegmentIntersection inter = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(y, circle, (Segment)parser.Get(new Segment(a, f))));

            given.Add(new Strengthened(angle, new RightAngle(angle)));
            given.Add(new Strengthened(inter, new Tangent(inter)));
            given.Add(new Strengthened(tri, new RightTriangle(tri)));
            given.Add(new GeometricParallel((Segment)parser.Get(new Segment(c, d)), (Segment)parser.Get(new Segment(b, e))));
            given.Add(new GeometricParallel((Segment)parser.Get(new Segment(c, d)), (Segment)parser.Get(new Segment(a, f))));
            given.Add(new GeometricCongruentSegments((Segment)parser.Get(new Segment(d, e)), (Segment)parser.Get(new Segment(e, f))));

            known.AddSegmentLength((Segment)parser.Get(new Segment(a, f)), 16);
            known.AddSegmentLength((Segment)parser.Get(new Segment(c, d)), 20);
            known.AddSegmentLength((Segment)parser.Get(new Segment(a, c)), 8);

            List <Point> wanted = new List <Point>();

            wanted.Add(new Point("", 1, 1));
            wanted.Add(new Point("", 15, 1));
            wanted.Add(new Point("", 3, 7));
            wanted.Add(new Point("", 10, 5));
            goalRegions = parser.implied.GetAtomicRegionsByPoints(wanted);

            SetSolutionArea(144 - System.Math.PI * 8);
        }
Пример #14
0
        //
        // Find every point of intersection among segments (if they are not labeled in the UI) -- name them.
        //
        public List <CircleSegmentIntersection> FindCircleSegmentIntersections()
        {
            List <CircleSegmentIntersection> intersections = new List <CircleSegmentIntersection>();

            foreach (GeometryTutorLib.ConcreteAST.Circle circle in implied.circles)
            {
                foreach (GeometryTutorLib.ConcreteAST.Segment segment in implied.segments)
                {
                    Point inter1 = null;
                    Point inter2 = null;
                    circle.FindIntersection(segment, out inter1, out inter2);

                    if (!segment.PointLiesOnAndBetweenEndpoints(inter1))
                    {
                        inter1 = null;
                    }
                    if (!segment.PointLiesOnAndBetweenEndpoints(inter2))
                    {
                        inter2 = null;
                    }

                    // Analyze this segment w.r.t. to this circle: tangent, secant, chord.
                    if (inter1 != null || inter2 != null)
                    {
                        circle.AnalyzeSegment(segment, implied.allFigurePoints);
                    }
                }
            }

            foreach (GeometryTutorLib.ConcreteAST.Circle circle in implied.circles)
            {
                foreach (GeometryTutorLib.ConcreteAST.Segment segment in implied.maximalSegments)
                {
                    //
                    // Find any intersection points between the circle and the segment;
                    // the intersection MUST be between the segment endpoints
                    //
                    Point inter1 = null;
                    Point inter2 = null;
                    circle.FindIntersection(segment, out inter1, out inter2);
                    if (!segment.PointLiesOnAndBetweenEndpoints(inter1))
                    {
                        inter1 = null;
                    }
                    if (!segment.PointLiesOnAndBetweenEndpoints(inter2))
                    {
                        inter2 = null;
                    }

                    // Add them to the list (possibly)
                    List <Point> intersectionPts = new List <Point>();
                    if (inter1 != null)
                    {
                        intersectionPts.Add(inter1);
                    }
                    if (inter2 != null)
                    {
                        intersectionPts.Add(inter2);
                    }

                    // normalized to drawing point (names)
                    intersectionPts = implied.NormalizePointsToDrawing(intersectionPts);

                    // and add to each figure (circle and polygon).
                    circle.AddIntersectingPoints(intersectionPts);

                    //
                    // Construct the intersections
                    //
                    CircleSegmentIntersection csInter = null;

                    if (intersectionPts.Any())
                    {
                        csInter = new CircleSegmentIntersection(intersectionPts[0], circle, segment);
                        GeometryTutorLib.Utilities.AddStructurallyUnique <CircleSegmentIntersection>(intersections, csInter);
                    }
                    if (intersectionPts.Count > 1)
                    {
                        csInter = new CircleSegmentIntersection(intersectionPts[1], circle, segment);
                        GeometryTutorLib.Utilities.AddStructurallyUnique <CircleSegmentIntersection>(intersections, csInter);
                    }
                }

                // Complete any processing attributed to the circle and all the segments.
                circle.CleanUp();
            }

            return(intersections);
        }
Пример #15
0
        public Page7Prob26(bool onoff, bool complete)
            : base(onoff, complete)
        {
            Point a = new Point("A", 0, 0); points.Add(a);
            Point b = new Point("B", 0, 4); points.Add(b);
            Point c = new Point("C", 4, 4); points.Add(c);
            Point d = new Point("D", 4, 0); points.Add(d);
            Point o = new Point("O", 2, 2); points.Add(o);
            Point p = new Point("P", 0, 2); points.Add(p);
            Point q = new Point("Q", 4, 2); points.Add(q);

            Segment bc = new Segment(b, c); segments.Add(bc);
            Segment da = new Segment(d, a); segments.Add(da);

            List <Point> pts = new List <Point>();

            pts.Add(a); pts.Add(p); pts.Add(b);
            collinear.Add(new Collinear(pts));

            pts = new List <Point>();
            pts.Add(p); pts.Add(o); pts.Add(q);
            collinear.Add(new Collinear(pts));

            pts = new List <Point>();
            pts.Add(c); pts.Add(q); pts.Add(d);
            collinear.Add(new Collinear(pts));

            Circle circle = new Circle(o, 2);

            circles.Add(circle);

            parser = new GeometryTutorLib.TutorParser.HardCodedParserMain(points, collinear, segments, circles, onoff);

            Segment cd = (Segment)parser.Get(new Segment(c, d));
            Angle   a1 = (Angle)parser.Get(new Angle(a, b, c));
            Angle   a2 = (Angle)parser.Get(new Angle(b, c, d));
            Angle   a3 = (Angle)parser.Get(new Angle(c, d, a));
            Angle   a4 = (Angle)parser.Get(new Angle(d, a, b));
            CircleSegmentIntersection cInter = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(q, circle, cd));

            known.AddSegmentLength(da, 4);
            known.AddSegmentLength(cd, 4);

            given.Add(new Strengthened(a1, new RightAngle(a1)));
            given.Add(new Strengthened(a2, new RightAngle(a2)));
            given.Add(new Strengthened(a3, new RightAngle(a3)));
            given.Add(new Strengthened(a4, new RightAngle(a4)));
            given.Add(new GeometricSegmentEquation(da, new NumericValue(4)));
            given.Add(new GeometricSegmentEquation(cd, new NumericValue(4)));
            given.Add(new Strengthened(cInter, new Tangent(cInter)));

            List <Point> unwanted = new List <Point>();

            unwanted.Add(new Point("", 0.1, 3.8));
            unwanted.Add(new Point("", 3.9, 3.8));
            goalRegions = parser.implied.GetAllAtomicRegionsWithoutPoints(unwanted);

            SetSolutionArea(8 + 2 * System.Math.PI);

            problemName = "McDougall Page 7 Problem 24";
            GeometryTutorLib.EngineUIBridge.HardCodedProblemsToUI.AddProblem(problemName, points, circles, segments);
        }
        //               A
        //              |)
        //              | )
        //              |  )
        // Q------- O---X---) D
        //              |  )
        //              | )
        //              |)
        //               C
        //
        // Perpendicular(Segment(Q, D), Segment(A, C)) -> Congruent(Arc(A, D), Arc(D, C)) -> Congruent(Segment(AX), Segment(XC))
        //
        private static List <EdgeAggregator> InstantiateTheorem(Intersection inter, CircleSegmentIntersection arcInter, Perpendicular perp, GroundedClause original)
        {
            List <EdgeAggregator> newGrounded = new List <EdgeAggregator>();

            //
            // Does this intersection apply to this perpendicular?
            //
            if (!inter.intersect.StructurallyEquals(perp.intersect))
            {
                return(newGrounded);
            }

            // Is this too restrictive?
            if (!((inter.HasSegment(perp.lhs) && inter.HasSegment(perp.rhs)) && (perp.HasSegment(inter.lhs) && perp.HasSegment(inter.rhs))))
            {
                return(newGrounded);
            }

            //
            // Does this perpendicular intersection apply to a given circle?
            //
            // Acquire the circles for which the segments are secants.
            List <Circle> secantCircles1 = Circle.GetSecantCircles(perp.lhs);
            List <Circle> secantCircles2 = Circle.GetSecantCircles(perp.rhs);

            List <Circle> intersection = Utilities.Intersection <Circle>(secantCircles1, secantCircles2);

            if (!intersection.Any())
            {
                return(newGrounded);
            }

            //
            // Find the single, unique circle that has as chords the components of the perpendicular intersection
            //
            Circle  theCircle = null;
            Segment chord1    = null;
            Segment chord2    = null;

            foreach (Circle circle in intersection)
            {
                chord1 = circle.GetChord(perp.lhs);
                chord2 = circle.GetChord(perp.rhs);
                if (chord1 != null && chord2 != null)
                {
                    theCircle = circle;
                    break;
                }
            }

            Segment diameter = chord1.Length > chord2.Length ? chord1 : chord2;
            Segment chord    = chord1.Length < chord2.Length ? chord1 : chord2;

            //
            // Does the arc intersection apply?
            //
            if (!arcInter.HasSegment(diameter))
            {
                return(newGrounded);
            }
            if (!theCircle.StructurallyEquals(arcInter.theCircle))
            {
                return(newGrounded);
            }

            //
            // Create the bisector
            //
            Strengthened sb = new Strengthened(inter, new SegmentBisector(inter, diameter));
            Strengthened ab = new Strengthened(arcInter, new ArcSegmentBisector(arcInter));

            // For hypergraph
            List <GroundedClause> antecedentArc = new List <GroundedClause>();

            antecedentArc.Add(arcInter);
            antecedentArc.Add(original);
            antecedentArc.Add(theCircle);

            newGrounded.Add(new EdgeAggregator(antecedentArc, ab, annotation));

            List <GroundedClause> antecedentSegment = new List <GroundedClause>();

            antecedentSegment.Add(inter);
            antecedentSegment.Add(original);
            antecedentSegment.Add(theCircle);

            newGrounded.Add(new EdgeAggregator(antecedentSegment, sb, annotation));

            return(newGrounded);
        }
Пример #17
0
        public Page8Prob39(bool onoff, bool complete)
            : base(onoff, complete)
        {
            Point o = new Point("O", 0, 0); points.Add(o);
            Point a = new Point("A", -3.5, -3.5); points.Add(a);
            Point b = new Point("B", -3.5, 3.5); points.Add(b);
            Point c = new Point("C", 3.5, 3.5); points.Add(c);
            Point d = new Point("D", 3.5, -3.5); points.Add(d);
            Point e = new Point("E", -1.5, 1.5 / System.Math.Sqrt(3)); points.Add(e);
            Point f = new Point("F", 1.5, 1.5 / System.Math.Sqrt(3)); points.Add(f);
            Point g = new Point("G", 0, 3 / System.Math.Sqrt(3)); points.Add(g);

            Point w = new Point("W", 0, -3.5); points.Add(w);
            Point x = new Point("X", -3.5, 0); points.Add(x);
            Point y = new Point("Y", 0, 3.5); points.Add(y);
            Point z = new Point("W", 3.5, 0); points.Add(w);

            //Segment ab = new Segment(a, b); segments.Add(ab);
            //Segment bc = new Segment(b, c); segments.Add(bc);
            //Segment cd = new Segment(c, d); segments.Add(cd);
            //Segment da = new Segment(d, a); segments.Add(da);
            Segment ef = new Segment(e, f); segments.Add(ef);
            Segment fg = new Segment(f, g); segments.Add(fg);
            Segment ge = new Segment(g, e); segments.Add(ge);

            List <Point> pnts = new List <Point>();

            pnts.Add(a); pnts.Add(x); pnts.Add(b);
            collinear.Add(new Collinear(pnts));

            pnts = new List <Point>();
            pnts.Add(b); pnts.Add(y); pnts.Add(c);
            collinear.Add(new Collinear(pnts));

            pnts = new List <Point>();
            pnts.Add(c); pnts.Add(z); pnts.Add(d);
            collinear.Add(new Collinear(pnts));

            pnts = new List <Point>();
            pnts.Add(d); pnts.Add(w); pnts.Add(a);
            collinear.Add(new Collinear(pnts));

            Circle circle = new Circle(o, 3.5);

            circles.Add(circle);

            parser = new GeometryTutorLib.TutorParser.HardCodedParserMain(points, collinear, segments, circles, onoff);

            known.AddSegmentLength((Segment)parser.Get(new Segment(a, b)), 7);
            known.AddSegmentLength(ef, 3);

            given.Add(new GeometricCongruentSegments(ef, fg));
            given.Add(new GeometricCongruentSegments(ef, ge));

            Angle angle = (Angle)parser.Get(new Angle(b, a, d));
            CircleSegmentIntersection cInter1 = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(x, circle,
                                                                                                                    (Segment)parser.Get(new Segment(a, b))));
            CircleSegmentIntersection cInter2 = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(y, circle,
                                                                                                                    (Segment)parser.Get(new Segment(b, c))));
            CircleSegmentIntersection cInter3 = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(z, circle,
                                                                                                                    (Segment)parser.Get(new Segment(c, d))));
            CircleSegmentIntersection cInter4 = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(w, circle,
                                                                                                                    (Segment)parser.Get(new Segment(d, a))));

            given.Add(new Strengthened(angle, new RightAngle(angle)));

            List <Point> wanted = new List <Point>();

            wanted.Add(new Point("", 3, 0));
            goalRegions = parser.implied.GetAtomicRegionsByPoints(wanted);

            SetSolutionArea((12.25 * System.Math.PI) - (1.5 * System.Math.Sqrt(6.75)));

            problemName = "Glencoe Page 8 Problem 39";
            GeometryTutorLib.EngineUIBridge.HardCodedProblemsToUI.AddProblem(problemName, points, circles, segments);
        }
        //
        //          C
        //         /)
        //        /  )
        //       / )
        //      / )
        //   A /)_________ B
        //
        // Tangent(Circle(O), Segment(AB)), Intersection(Segment(AC), Segment(AB)) -> 2 * Angle(CAB) = Arc(C, B)
        //
        public static List <EdgeAggregator> InstantiateTheorem(Intersection inter, Tangent tangent, GroundedClause original)
        {
            List <EdgeAggregator> newGrounded = new List <EdgeAggregator>();

            CircleSegmentIntersection tan = tangent.intersection as CircleSegmentIntersection;

            //
            // Does this tangent apply to this intersection?
            //
            if (!inter.intersect.StructurallyEquals(tangent.intersection.intersect))
            {
                return(newGrounded);
            }

            Segment secant     = null;
            Segment tanSegment = null;

            if (tan.HasSegment(inter.lhs))
            {
                secant     = inter.rhs;
                tanSegment = inter.lhs;
            }
            else if (tan.HasSegment(inter.rhs))
            {
                secant     = inter.lhs;
                tanSegment = inter.rhs;
            }
            else
            {
                return(newGrounded);
            }

            //
            // Acquire the angle and intercepted arc.
            //
            Segment chord = tan.theCircle.GetChord(secant);

            if (chord == null)
            {
                return(newGrounded);
            }
            //Segment chord = tan.theCircle.ContainsChord(secant);

            // Arc
            // We want the MINOR ARC only!
            if (tan.theCircle.DefinesDiameter(chord))
            {
                Arc   theArc = null;
                Point midpt  = PointFactory.GeneratePoint(tan.theCircle.Midpoint(chord.Point1, chord.Point2));
                Point opp    = PointFactory.GeneratePoint(tan.theCircle.OppositePoint(midpt));

                Point tanPoint = tanSegment.OtherPoint(inter.intersect);

                if (tanPoint != null)
                {
                    // Angle; the smaller angle is always the chosen angle
                    Angle theAngle = new Angle(chord.OtherPoint(inter.intersect), inter.intersect, tanPoint);

                    theArc = new Semicircle(tan.theCircle, chord.Point1, chord.Point2, midpt, chord);
                    newGrounded.Add(CreateClause(inter, original, theAngle, theArc));

                    theArc = new Semicircle(tan.theCircle, chord.Point1, chord.Point2, opp, chord);
                    newGrounded.Add(CreateClause(inter, original, theAngle, theArc));
                }
                else
                {
                    // Angle; the smaller angle is always the chosen angle
                    Angle theAngle = new Angle(chord.OtherPoint(inter.intersect), inter.intersect, tanSegment.Point1);

                    theArc = new Semicircle(tan.theCircle, chord.Point1, chord.Point2, midpt, chord);
                    newGrounded.Add(CreateClause(inter, original, theAngle, theArc));

                    theArc = new Semicircle(tan.theCircle, chord.Point1, chord.Point2, opp, chord);
                    newGrounded.Add(CreateClause(inter, original, theAngle, theArc));

                    // Angle; the smaller angle is always the chosen angle
                    theAngle = new Angle(chord.OtherPoint(inter.intersect), inter.intersect, tanSegment.Point2);

                    theArc = new Semicircle(tan.theCircle, chord.Point1, chord.Point2, midpt, chord);
                    newGrounded.Add(CreateClause(inter, original, theAngle, theArc));

                    theArc = new Semicircle(tan.theCircle, chord.Point1, chord.Point2, opp, chord);
                    newGrounded.Add(CreateClause(inter, original, theAngle, theArc));
                }
            }
            else
            {
                Arc theArc = new MinorArc(tan.theCircle, chord.Point1, chord.Point2);

                // Angle; the smaller angle is always the chosen angle
                Point endPnt   = (inter.intersect.StructurallyEquals(tanSegment.Point1)) ? tanSegment.Point2 : tanSegment.Point1;
                Angle theAngle = new Angle(chord.OtherPoint(inter.intersect), inter.intersect, endPnt);

                if (theAngle.measure > 90)
                {
                    //If the angle endpoint was already set to Point2, or if the intersect equals Point2, then the smaller angle does not exist
                    //In this case, should we create a major arc or return nothing?
                    if (endPnt.StructurallyEquals(tanSegment.Point2) || inter.intersect.StructurallyEquals(tanSegment.Point2))
                    {
                        return(newGrounded);
                    }
                    theAngle = new Angle(chord.OtherPoint(inter.intersect), inter.intersect, tanSegment.Point2);
                }

                Multiplication            product  = new Multiplication(new NumericValue(2), theAngle);
                GeometricAngleArcEquation angArcEq = new GeometricAngleArcEquation(product, theArc);

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

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



            return(newGrounded);
        }
Пример #19
0
        //Demonstrates: ExteriorAngleHalfDifferenceInterceptedArcs : two tangents
        //Demonstrates: Tangents from point are congruent

        public Test05(bool onoff, bool complete)
            : base(onoff, complete)
        {
            //Circle
            Point  o       = new Point("O", 0, 0); points.Add(o);
            Circle circleO = new Circle(o, 5.0);

            circles.Add(circleO);

            //Intersection point for two tangents
            Point c = new Point("C", 0, 6.25); points.Add(c);

            //Points for tangent line ac, intersection at b
            Point a = new Point("A", -8, 0.25); points.Add(a);
            Point b = new Point("B", -3, 4); points.Add(b);

            //Points for tangent line ec, intersection at d
            Point e = new Point("E", 8, 0.25); points.Add(e);
            Point d = new Point("D", 3, 4); points.Add(d);

            //Create point for another arc (Arc(DF)) of equal measure to (1/2)*(MajorArc(BD)-MinorArc(BD))
            MinorArc minor   = new MinorArc(circleO, b, d);
            MajorArc major   = new MajorArc(circleO, b, d);
            double   measure = (major.GetMajorArcMeasureDegrees() - minor.GetMinorArcMeasureDegrees()) / 2;
            //Get theta for D and E
            Circle unit = new Circle(o, 1.0);
            Point  inter1, trash;

            unit.FindIntersection(new Segment(o, d), out inter1, out trash);
            if (inter1.X < 0)
            {
                inter1 = trash;
            }
            double dThetaDegrees = (System.Math.Acos(inter1.X)) * (180 / System.Math.PI);
            double fThetaRadians = (dThetaDegrees - measure) * (System.Math.PI / 180);
            //Get coordinates for E
            Point unitPnt = new Point("", System.Math.Cos(fThetaRadians), System.Math.Sin(fThetaRadians));
            Point f;

            circleO.FindIntersection(new Segment(o, unitPnt), out f, out trash);
            if (f.X < 0)
            {
                f = trash;
            }
            f = new Point("F", f.X, f.Y); points.Add(f);

            //Should now be able to form segments for a central angle of equal measure to (1/2)*(Arc(AB)-Arc(CD))
            Segment od = new Segment(o, d); segments.Add(od);
            Segment of = new Segment(o, f); segments.Add(of);

            List <Point> pnts = new List <Point>();

            pnts.Add(a);
            pnts.Add(b);
            pnts.Add(c);
            collinear.Add(new Collinear(pnts));

            pnts = new List <Point>();
            pnts.Add(c);
            pnts.Add(d);
            pnts.Add(e);
            collinear.Add(new Collinear(pnts));

            parser = new LiveGeometry.TutorParser.HardCodedParserMain(points, collinear, segments, circles, onoff);

            Segment ac = (Segment)parser.Get(new Segment(a, c));
            Segment ce = (Segment)parser.Get(new Segment(c, e));
            CircleSegmentIntersection cInter  = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(b, circleO, ac));
            CircleSegmentIntersection cInter2 = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(d, circleO, ce));

            given.Add(new Strengthened(cInter, new Tangent(cInter)));
            given.Add(new Strengthened(cInter2, new Tangent(cInter2)));

            MinorArc a1 = (MinorArc)parser.Get(new MinorArc(circleO, b, d));
            MajorArc a2 = (MajorArc)parser.Get(new MajorArc(circleO, b, d));
            MinorArc centralAngleArc = (MinorArc)parser.Get(new MinorArc(circleO, d, f));

            given.Add(new GeometricArcEquation(new Multiplication(new NumericValue(2), centralAngleArc), new Subtraction(a2, a1)));

            goals.Add(new GeometricCongruentAngles((Angle)parser.Get(new Angle(a, c, e)), (Angle)parser.Get(new Angle(d, o, f))));
            goals.Add(new GeometricCongruentSegments((Segment)parser.Get(new Segment(b, c)), (Segment)parser.Get(new Segment(c, d))));
        }
Пример #20
0
        public Page8Prob15(bool onoff, bool complete)
            : base(onoff, complete)
        {
            Point a = new Point("A", 0, 0); points.Add(a);
            Point b = new Point("B", 0, 5); points.Add(b);
            Point c = new Point("C", 10, 5); points.Add(c);
            Point d = new Point("D", 10, 0); points.Add(d);
            Point o = new Point("O", 2.5, 2.5); points.Add(o);
            Point p = new Point("P", 2.5, 5); points.Add(p);
            Point q = new Point("Q", 2.5, 0); points.Add(q);

            Segment ab = new Segment(a, b); segments.Add(ab);
            Segment cd = new Segment(c, d); segments.Add(cd);

            List <Point> pnts = new List <Point>();

            pnts.Add(b);
            pnts.Add(p);
            pnts.Add(c);
            collinear.Add(new Collinear(pnts));

            pnts = new List <Point>();
            pnts.Add(a);
            pnts.Add(q);
            pnts.Add(d);
            collinear.Add(new Collinear(pnts));

            pnts = new List <Point>();
            pnts.Add(p);
            pnts.Add(o);
            pnts.Add(q);
            collinear.Add(new Collinear(pnts));

            Circle circle = new Circle(o, 2.5);

            circles.Add(circle);

            parser = new GeometryTutorLib.TutorParser.HardCodedParserMain(points, collinear, segments, circles, onoff);

            Angle   rA = (Angle)parser.Get(new Angle(a, d, c));
            Segment bc = (Segment)parser.Get(new Segment(b, c));
            Segment ad = (Segment)parser.Get(new Segment(a, d));
            CircleSegmentIntersection cInter1 = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(p, circle, bc));
            CircleSegmentIntersection cInter2 = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(q, circle, ad));

            known.AddSegmentLength((Segment)parser.Get(new Segment(c, d)), 5);
            known.AddSegmentLength(ad, 10);
            known.AddAngleMeasureDegree(rA, 90);

            given.Add(new Strengthened(rA, new RightAngle(rA)));
            given.Add(new Strengthened(cInter1, new Tangent(cInter1)));
            given.Add(new Strengthened(cInter2, new Tangent(cInter2)));

            //Quadrilateral quad = (Quadrilateral)parser.Get(new Quadrilateral(ab, cd, bc, ad));
            //given.Add(new Strengthened(quad, new Rectangle(quad)));

            List <Point> wanted = new List <Point>();

            wanted.Add(new Point("", 0.5, 4.5));
            wanted.Add(new Point("", 0.1, 0.1));
            wanted.Add(new Point("", 7, 3));
            wanted.Add(new Point("", 7, 1));
            goalRegions = parser.implied.GetAtomicRegionsByPoints(wanted);

            SetSolutionArea(50 - 6.25 * System.Math.PI);

            problemName = "Glencoe Page 8 Problem 15";
            GeometryTutorLib.EngineUIBridge.HardCodedProblemsToUI.AddProblem(problemName, points, circles, segments);
        }
Пример #21
0
        public Page86Prob13(bool onoff, bool complete)
            : base(onoff, complete)
        {
            Point a = new Point("A", 0, 0); points.Add(a);
            Point b = new Point("B", -5.5, 12); points.Add(b);
            Point c = new Point("C", 14.5, 12); points.Add(c);
            Point d = new Point("D", 9, 0); points.Add(d);
            Point o = new Point("O", 4.5, 12); points.Add(o);
            Point p = new Point("P", 4.5, 6); points.Add(p);
            Point q = new Point("Q", 4.5, 0); points.Add(q);

            Segment ab = new Segment(a, b); segments.Add(ab);
            Segment cd = new Segment(c, d); segments.Add(cd);

            List <Point> pnts = new List <Point>();

            pnts.Add(b);
            pnts.Add(o);
            pnts.Add(c);
            collinear.Add(new Collinear(pnts));

            pnts = new List <Point>();
            pnts.Add(a);
            pnts.Add(q);
            pnts.Add(d);
            collinear.Add(new Collinear(pnts));

            pnts = new List <Point>();
            pnts.Add(o);
            pnts.Add(p);
            pnts.Add(q);
            collinear.Add(new Collinear(pnts));

            Circle circle = new Circle(p, 6);

            circles.Add(circle);

            parser = new GeometryTutorLib.TutorParser.HardCodedParserMain(points, collinear, segments, circles, onoff);

            Segment ad = (Segment)parser.Get(new Segment(a, d));
            Segment bc = (Segment)parser.Get(new Segment(b, c));
            CircleSegmentIntersection cInter1 = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(q, circle, ad));
            CircleSegmentIntersection cInter2 = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(o, circle, bc));

            given.Add(new Strengthened(cInter1, new Tangent(cInter1)));
            given.Add(new Strengthened(cInter2, new Tangent(cInter2)));

            known.AddSegmentLength(ad, 9);
            //This top base was length 10 in the original problem, but this wouldn't actually be possible since the
            //inscribed circle has a total diameter of length 12. So changed the top base to length 20.
            known.AddSegmentLength(bc, 20);
            known.AddSegmentLength((Segment)parser.Get(new Segment(o, p)), 6);

            List <Point> wanted = new List <Point>();

            wanted.Add(new Point("", 0.5, 0.2));
            wanted.Add(new Point("", -0.3, 11));
            wanted.Add(new Point("", 9.2, 11));
            wanted.Add(new Point("", 8.5, 0.2));
            goalRegions = parser.implied.GetAtomicRegionsByPoints(wanted);

            SetSolutionArea(174 - 36 * System.Math.PI);

            problemName = "Collected Learning Page 86 Prob 13";
            GeometryTutorLib.EngineUIBridge.HardCodedProblemsToUI.AddProblem(problemName, points, circles, segments);
        }
Пример #22
0
        //Demonstrates: ExteriorAngleHalfDifferenceInterceptedArcs : one tangent, one secant

        public Test06(bool onoff, bool complete)
            : base(onoff, complete)
        {
            //Circle
            Point  o       = new Point("O", 0, 0); points.Add(o);
            Circle circleO = new Circle(o, 5.0);

            circles.Add(circleO);

            //Intersection point for tangent & secant
            Point c = new Point("C", 0, 6.25); points.Add(c);

            //Points for tangent line ac, intersection at b
            Point a = new Point("A", -8, 0.25); points.Add(a);
            Point b = new Point("B", -3, 4); points.Add(b);

            //Points for secant line ce, intersections at D & E
            Point d = new Point("D", 0, 5); points.Add(d);
            Point e = new Point("E", 0, -5); points.Add(e);

            //Create point for another arc (Arc(DF)) of equal measure to (1/2)*(MinorArc(BE)-MinorArc(BD))
            MinorArc farMinor   = new MinorArc(circleO, b, e);
            MinorArc closeMinor = new MinorArc(circleO, b, d);
            double   measure    = (farMinor.GetMinorArcMeasureDegrees() - closeMinor.GetMinorArcMeasureDegrees()) / 2;
            //Get theta for F
            double dThetaDegrees = 90;
            double fThetaRadians = (dThetaDegrees - measure) * (System.Math.PI / 180);
            //Get coordinates for F
            Point unitPnt = new Point("", System.Math.Cos(fThetaRadians), System.Math.Sin(fThetaRadians));
            Point f, trash;

            circleO.FindIntersection(new Segment(o, unitPnt), out f, out trash);
            if (f.X < 0)
            {
                f = trash;
            }
            f = new Point("F", f.X, f.Y); points.Add(f);

            //Should now be able to form segments for a central angle of equal measure to (1/2)*(Arc(AB)-Arc(CD))
            Segment od = new Segment(o, d); segments.Add(od);
            Segment of = new Segment(o, f); segments.Add(of);

            List <Point> pnts = new List <Point>();

            pnts.Add(a);
            pnts.Add(b);
            pnts.Add(c);
            collinear.Add(new Collinear(pnts));

            pnts = new List <Point>();
            pnts.Add(c);
            pnts.Add(d);
            pnts.Add(e);
            collinear.Add(new Collinear(pnts));

            parser = new GeometryTutorLib.TutorParser.HardCodedParserMain(points, collinear, segments, circles, onoff);

            Segment ac = (Segment)parser.Get(new Segment(a, c));
            CircleSegmentIntersection cInter = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(b, circleO, ac));

            given.Add(new Strengthened(cInter, new Tangent(cInter)));

            MinorArc far             = (MinorArc)parser.Get(new MinorArc(circleO, b, e));
            MinorArc close           = (MinorArc)parser.Get(new MinorArc(circleO, b, d));
            MinorArc centralAngleArc = (MinorArc)parser.Get(new MinorArc(circleO, d, f));

            given.Add(new GeometricArcEquation(new Multiplication(new NumericValue(2), centralAngleArc), new Subtraction(far, close)));

            goals.Add(new GeometricCongruentAngles((Angle)parser.Get(new Angle(a, c, e)), (Angle)parser.Get(new Angle(d, o, f))));
        }
Пример #23
0
        public Page8Row6Prob42(bool onoff, bool complete)
            : base(onoff, complete)
        {
            //Square vertices
            Point a = new Point("A", 0, 0); points.Add(a);
            Point b = new Point("B", 0, 6); points.Add(b);
            Point c = new Point("C", 6, 6); points.Add(c);
            Point d = new Point("D", 6, 0); points.Add(d);

            //Circle centers
            Point q = new Point("Q", 1.5, 1.5); points.Add(q);
            Point r = new Point("R", 1.5, 4.5); points.Add(r);
            Point s = new Point("S", 4.5, 4.5); points.Add(s);
            Point t = new Point("T", 4.5, 1.5); points.Add(t);

            //Circle-Square intersections
            Point e = new Point("E", 0, 1.5); points.Add(e);
            Point f = new Point("F", 0, 4.5); points.Add(f);
            Point g = new Point("G", 1.5, 6); points.Add(g);
            Point h = new Point("H", 4.5, 6); points.Add(h);
            Point i = new Point("I", 6, 4.5); points.Add(i);
            Point j = new Point("J", 6, 1.5); points.Add(j);
            Point k = new Point("K", 4.5, 0); points.Add(k);
            Point l = new Point("L", 1.5, 0); points.Add(l);

            //Circle-circle intersections
            Point m = new Point("M", 1.5, 3); points.Add(m);
            Point n = new Point("N", 3, 4.5); points.Add(n);
            Point o = new Point("O", 4.5, 3); points.Add(o);
            Point p = new Point("P", 3, 1.5); points.Add(p);


            //Square sides
            List <Point> pts = new List <Point>();

            pts.Add(a);
            pts.Add(e);
            pts.Add(f);
            pts.Add(b);
            collinear.Add(new Collinear(pts));

            pts = new List <Point>();
            pts.Add(b);
            pts.Add(g);
            pts.Add(h);
            pts.Add(c);
            collinear.Add(new Collinear(pts));

            pts = new List <Point>();
            pts.Add(c);
            pts.Add(i);
            pts.Add(j);
            pts.Add(d);
            collinear.Add(new Collinear(pts));

            pts = new List <Point>();
            pts.Add(d);
            pts.Add(k);
            pts.Add(l);
            pts.Add(a);
            collinear.Add(new Collinear(pts));

            //Diameters
            pts = new List <Point>();
            pts.Add(f);
            pts.Add(r);
            pts.Add(n);
            pts.Add(s);
            pts.Add(i);
            collinear.Add(new Collinear(pts));

            pts = new List <Point>();
            pts.Add(e);
            pts.Add(q);
            pts.Add(p);
            pts.Add(t);
            pts.Add(j);
            collinear.Add(new Collinear(pts));

            pts = new List <Point>();
            pts.Add(g);
            pts.Add(r);
            pts.Add(m);
            pts.Add(q);
            pts.Add(l);
            collinear.Add(new Collinear(pts));

            pts = new List <Point>();
            pts.Add(h);
            pts.Add(s);
            pts.Add(o);
            pts.Add(t);
            pts.Add(k);
            collinear.Add(new Collinear(pts));

            Circle tLeft  = new Circle(r, 1.5);
            Circle bLeft  = new Circle(q, 1.5);
            Circle tRight = new Circle(s, 1.5);
            Circle bRight = new Circle(t, 1.5);

            circles.Add(tLeft);
            circles.Add(bLeft);
            circles.Add(tRight);
            circles.Add(bRight);

            parser = new GeometryTutorLib.TutorParser.HardCodedParserMain(points, collinear, segments, circles, onoff);

            known.AddSegmentLength((Segment)parser.Get(new Segment(a, b)), 6);

            Segment ab = (Segment)parser.Get(new Segment(a, b));
            Segment bc = (Segment)parser.Get(new Segment(b, c));
            Segment cd = (Segment)parser.Get(new Segment(c, d));
            Segment ad = (Segment)parser.Get(new Segment(a, d));
            CircleSegmentIntersection cInter1  = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(e, bLeft, ab));
            CircleSegmentIntersection cInter2  = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(f, tLeft, ab));
            CircleSegmentIntersection cInter3  = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(g, tLeft, bc));
            CircleSegmentIntersection cInter4  = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(h, tRight, bc));
            CircleSegmentIntersection cInter5  = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(i, tRight, cd));
            CircleSegmentIntersection cInter6  = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(j, bRight, cd));
            CircleSegmentIntersection cInter7  = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(k, bRight, ad));
            CircleSegmentIntersection cInter8  = (CircleSegmentIntersection)parser.Get(new CircleSegmentIntersection(l, bLeft, ad));
            CircleCircleIntersection  cInter9  = (CircleCircleIntersection)parser.Get(new CircleCircleIntersection(m, tLeft, bLeft));
            CircleCircleIntersection  cInter10 = (CircleCircleIntersection)parser.Get(new CircleCircleIntersection(n, tLeft, tRight));
            CircleCircleIntersection  cInter11 = (CircleCircleIntersection)parser.Get(new CircleCircleIntersection(o, tRight, bRight));
            CircleCircleIntersection  cInter12 = (CircleCircleIntersection)parser.Get(new CircleCircleIntersection(p, bLeft, bRight));

            given.Add(new Strengthened(cInter1, new Tangent(cInter1)));
            given.Add(new Strengthened(cInter2, new Tangent(cInter2)));
            given.Add(new Strengthened(cInter3, new Tangent(cInter3)));
            given.Add(new Strengthened(cInter4, new Tangent(cInter4)));
            given.Add(new Strengthened(cInter5, new Tangent(cInter5)));
            given.Add(new Strengthened(cInter6, new Tangent(cInter6)));
            given.Add(new Strengthened(cInter7, new Tangent(cInter7)));
            given.Add(new Strengthened(cInter8, new Tangent(cInter8)));
            given.Add(new Strengthened(cInter9, new Tangent(cInter9)));
            given.Add(new Strengthened(cInter10, new Tangent(cInter10)));
            given.Add(new Strengthened(cInter11, new Tangent(cInter11)));
            given.Add(new Strengthened(cInter12, new Tangent(cInter12)));

            given.Add(new GeometricCongruentCircles(tLeft, bLeft));
            given.Add(new GeometricCongruentCircles(tLeft, tRight));
            given.Add(new GeometricCongruentCircles(tLeft, bRight));

            List <Point> wanted = new List <Point>();

            wanted.Add(new Point("", 0.1, 0.1));
            wanted.Add(new Point("", 0.1, 3));
            wanted.Add(new Point("", 0.1, 5.9));
            wanted.Add(new Point("", 3, 5.9));
            wanted.Add(new Point("", 3, 3));
            wanted.Add(new Point("", 3, 0.1));
            wanted.Add(new Point("", 5.9, 0.1));
            wanted.Add(new Point("", 5.9, 3));
            wanted.Add(new Point("", 5.9, 5.9));
            goalRegions = parser.implied.GetAtomicRegionsByPoints(wanted);

            SetSolutionArea(36 - (9 * System.Math.PI));

            problemName = "Glencoe Page 8 Row 6 Problem 42";
            GeometryTutorLib.EngineUIBridge.HardCodedProblemsToUI.AddProblem(problemName, points, circles, segments);
        }
        //
        //    A \ 
        //       \    B
        //        \  /
        //  O      \/ X
        //         /\
        //        /  \
        //     C /    D
        //
        // One Secant, One Tangent
        // Intersection(X, AD, BC), Tangent(Circle(O), BC) -> 2 * Angle(AXC) = MajorArc(AC) - MinorArc(AC)
        //
        public static List <EdgeAggregator> InstantiateOneSecantOneTangentTheorem(Intersection inter, Tangent tangent, GroundedClause original)
        {
            List <EdgeAggregator> newGrounded = new List <EdgeAggregator>();

            CircleSegmentIntersection tan = tangent.intersection as CircleSegmentIntersection;

            // Is the tangent segment part of the intersection?
            if (!inter.HasSegment(tan.segment))
            {
                return(newGrounded);
            }

            // Acquire the chord that the intersection creates.
            Segment secant = inter.OtherSegment(tan.segment);

            Circle  circle = tan.theCircle;
            Segment chord  = circle.ContainsChord(secant);

            // Check if this segment never intersects the circle or doesn't create a chord.
            if (chord == null)
            {
                return(newGrounded);
            }

            //
            // Get the near / far points out of the chord
            //
            Point closeChordPt = null;
            Point farChordPt   = null;

            if (Segment.Between(chord.Point1, chord.Point2, inter.intersect))
            {
                closeChordPt = chord.Point1;
                farChordPt   = chord.Point2;
            }
            else
            {
                closeChordPt = chord.Point2;
                farChordPt   = chord.Point1;
            }

            //
            // Acquire the arcs
            //
            // Get the close arc first which we know exactly how it is constructed AND that it's a minor arc.
            Arc closeArc = Arc.GetFigureMinorArc(circle, closeChordPt, tan.intersect);

            // The far arc MAY be a major arc; if it is, the first candidate arc will contain the close arc.
            Arc farArc = Arc.GetFigureMinorArc(circle, farChordPt, tan.intersect);

            if (farArc.HasMinorSubArc(closeArc))
            {
                farArc = Arc.GetFigureMajorArc(circle, farChordPt, tan.intersect);
            }

            Angle theAngle = Angle.AcquireFigureAngle(new Angle(closeChordPt, inter.intersect, tan.intersect));

            //
            // Construct the new relationship
            //
            NumericValue two = new NumericValue(2);

            GeometricAngleArcEquation gaaeq = new GeometricAngleArcEquation(new Multiplication(two, theAngle), new Subtraction(farArc, closeArc));

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

            antecedent.Add(original);
            antecedent.Add(inter);
            antecedent.Add(closeArc);
            antecedent.Add(farArc);

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

            return(newGrounded);
        }