Example #1
0
        //Demonstrates: ExteriorAngleHalfDifferenceInterceptedArcs : two secants
        public Test04(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 secants
            Point x = new Point("X", 0, 6); points.Add(x);

            //Secant intersection points for circle O
            Point a = new Point("A", -3, -4); points.Add(a);
            Point b = new Point("B", 3, -4); points.Add(b);
            Point c, d, trash;
            circleO.FindIntersection(new Segment(b, x), out c, out trash);
            if (b.StructurallyEquals(c)) c = trash;
            c = new Point("C", c.X, c.Y);
            points.Add(c);
            circleO.FindIntersection(new Segment(a, x), out d, out trash);
            if (a.StructurallyEquals(d)) d = trash;
            d = new Point("D", d.X, d.Y);
            points.Add(d);

            //Create point for another arc (Arc(CE)) of equal measure to (1/2)*(Arc(AB)-Arc(CD))
            Point e = new Point("E", 3, 4); points.Add(e);

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

            //Label the intersection betweeen OE and BX
            Point i = oe.FindIntersection(new Segment(b, x));
            i = new Point("I", i.X, i.Y); points.Add(i);

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

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

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

            MinorArc farMinor1 = (MinorArc)parser.Get(new MinorArc(circleO, a, b));
            MinorArc closeMinor1 = (MinorArc)parser.Get(new MinorArc(circleO, c, d));
            MinorArc centralAngleArc = (MinorArc)parser.Get(new MinorArc(circleO, c, e));
            given.Add(new GeometricArcEquation(new Multiplication(new NumericValue(2), centralAngleArc), new Subtraction(farMinor1, closeMinor1)));

            goals.Add(new GeometricCongruentAngles((Angle)parser.Get(new Angle(a, x, b)), (Angle)parser.Get(new Angle(c, o, e))));
        }
Example #2
0
        public Point OtherEndpoint(Point that)
        {
            if (that == null)
            {
                return(null);
            }

            if (that.StructurallyEquals(endpoint1))
            {
                return(endpoint2);
            }
            if (that.StructurallyEquals(endpoint2))
            {
                return(endpoint1);
            }

            return(null);
        }
Example #3
0
        public override bool PointLiesStrictlyOn(Point pt)
        {
            if (pt.StructurallyEquals(middlePoint))
            {
                return(true);
            }

            return(Arc.StrictlyBetweenMinor(pt, new MinorArc(theCircle, endpoint1, middlePoint)) ||
                   Arc.StrictlyBetweenMinor(pt, new MinorArc(theCircle, endpoint2, middlePoint)));
        }
Example #4
0
        /// <summary>
        /// Create a new angle.
        /// </summary>
        /// <param name="a">A point defining the angle.</param>
        /// <param name="b">A point defining the angle. This is the point the angle is actually at.</param>
        /// <param name="c">A point defining the angle.</param>
        public Angle(Point a, Point b, Point c) : base()
        {
            if (a.StructurallyEquals(b) || b.StructurallyEquals(c) || a.StructurallyEquals(c))
            {
                return;
                // throw new ArgumentException("Angle constructed with redundant vertices.");
            }
            this.A       = a;
            this.B       = b;
            this.C       = c;
            ray1         = new Segment(a, b);
            ray2         = new Segment(b, c);
            this.measure = toDegrees(findAngle(A, B, C));

            if (measure <= 0)
            {
                //System.Diagnostics.Debug.WriteLine("NO-OP");
                // throw new ArgumentException("Measure of " + this.ToString() + " is ZERO");
            }
        }
Example #5
0
        /// <summary>
        /// Create a new angle.
        /// </summary>
        /// <param name="a">A point defining the angle.</param>
        /// <param name="b">A point defining the angle. This is the point the angle is actually at.</param>
        /// <param name="c">A point defining the angle.</param>
        public Angle(Point a, Point b, Point c)
            : base()
        {
            if (a.StructurallyEquals(b) || b.StructurallyEquals(c) || a.StructurallyEquals(c))
            {
                return;
                // throw new ArgumentException("Angle constructed with redundant vertices.");
            }
            this.A = a;
            this.B = b;
            this.C = c;
            ray1 = new Segment(a, b);
            ray2 = new Segment(b, c);
            this.measure = toDegrees(findAngle(A, B, C));

            if (measure <= 0)
            {
                //System.Diagnostics.Debug.WriteLine("NO-OP");
                // throw new ArgumentException("Measure of " + this.ToString() + " is ZERO");
            }
        }
Example #6
0
        public Point OtherEndpoint(Point that)
        {
            if (that == null) return null;

            if (that.StructurallyEquals(endpoint1)) return endpoint2;
            if (that.StructurallyEquals(endpoint2)) return endpoint1;

            return null;
        }
Example #7
0
        ////
        //// Determine the intersection points / connections between this atomic region and a segment.
        ////
        //public List<IntersectionAgg> GetIntersections(Segment that)
        //{
        //    List<IntersectionAgg> intersections = new List<IntersectionAgg>();
        //    Point pt1 = null;
        //    Point pt2 = null;
        //    foreach (Connection conn in connections)
        //    {
        //        conn.FindIntersection(that, out pt1, out pt2);
        //        AddIntersection(intersections, pt1, conn);
        //        AddIntersection(intersections, pt2, conn);
        //    }
        //    return intersections;
        //}
        ////
        //// Determine the intersection points / connections between this atomic region and a connection.
        ////
        //private List<IntersectionAgg> GetIntersections(Connection that)
        //{
        //    if (that.type == ConnectionType.SEGMENT) return GetIntersections(that.segmentOwner as Segment);
        //    return new List<IntersectionAgg>();
        //    //return GetIntersections(that.segmentOwner as Circle, that.endpoint1, that.endpoint2);
        //}
        //
        // Get the index of the intersection with the same point of intersection.
        //
        private int IntersectionIndex(List<IntersectionAgg> intersections, Point pt)
        {
            if (pt == null) return -1;

            for (int a = 0; a < intersections.Count; a++)
            {
                if (pt.StructurallyEquals(intersections[a].intersection1)) return a;
                if (pt.StructurallyEquals(intersections[a].intersection2)) return a;
            }

            return -1;
        }
Example #8
0
        public override bool PointLiesStrictlyOn(Point pt)
        {
            if (pt.StructurallyEquals(middlePoint)) return true;

            return Arc.StrictlyBetweenMinor(pt, new MinorArc(theCircle, endpoint1, middlePoint)) ||
                   Arc.StrictlyBetweenMinor(pt, new MinorArc(theCircle, endpoint2, middlePoint));
        }