当前位置: 首页>>代码示例>>C#>>正文


C# Point.StructurallyEquals方法代码示例

本文整理汇总了C#中GeometryTutorLib.ConcreteAST.Point.StructurallyEquals方法的典型用法代码示例。如果您正苦于以下问题:C# Point.StructurallyEquals方法的具体用法?C# Point.StructurallyEquals怎么用?C# Point.StructurallyEquals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GeometryTutorLib.ConcreteAST.Point的用法示例。


在下文中一共展示了Point.StructurallyEquals方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Test04

        //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))));
        }
开发者ID:wcatykid,项目名称:GeoShader,代码行数:58,代码来源:Test04.cs

示例2: Angle

        /// <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");
            }
        }
开发者ID:wcatykid,项目名称:GeoShader,代码行数:27,代码来源:Angle.cs

示例3: OtherEndpoint

        public Point OtherEndpoint(Point that)
        {
            if (that == null) return null;

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

            return null;
        }
开发者ID:wcatykid,项目名称:GeoShader,代码行数:9,代码来源:Arc.cs

示例4: IntersectionIndex

        ////
        //// 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;
        }
开发者ID:wcatykid,项目名称:GeoShader,代码行数:40,代码来源:AtomicRegion.cs

示例5: PointLiesStrictlyOn

        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));
        }
开发者ID:wcatykid,项目名称:GeoShader,代码行数:7,代码来源:SemiCircle.cs


注:本文中的GeometryTutorLib.ConcreteAST.Point.StructurallyEquals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。