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


C# Line.XZIntercept方法代码示例

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


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

示例1: Line_XZIntercept

        public void Line_XZIntercept()
        {
            Line line1 = new Line(Point.MakePointWithInches(3, 2, 5), Point.MakePointWithInches(5, 3, 7)); //intersects at -1, 0, 1
            Line line2 = new Line(Point.MakePointWithInches(6, 0, 0), Point.MakePointWithInches(-5, 3, -1)); //intersects at 6, 0, 0
            Line line3 = new Line(Point.MakePointWithInches(1, 1, 5), Point.MakePointWithInches(2, 2, 4)); //intersects at 0, 0, 6
            Line line4 = new Line(Point.MakePointWithInches(4, 10, 1), Point.MakePointWithInches(4, 5, 2)); //intersects at 4, 0, 3
            Line line5 = new Line(Point.MakePointWithInches(4, 2, 2), Point.MakePointWithInches(4, 2, 1)); //doesnt intersect

            Point intercept1 = line1.XZIntercept();
            Point intercept2 = line2.XZIntercept();
            Point intercept3 = line3.XZIntercept();
            Point intercept4 = line4.XZIntercept();
            Point intercept5 = line5.XZIntercept();

            intercept1.Should().Be(Point.MakePointWithInches(-1, 0, 1));
            intercept2.Should().Be(Point.MakePointWithInches(6, 0, 0));
            intercept3.Should().Be(Point.MakePointWithInches(0, 0, 6));
            intercept4.Should().Be(Point.MakePointWithInches(4, 0, 3));
            intercept5.Should().Be(null);
        }
开发者ID:ParagonTruss,项目名称:GeometryClassLibrary,代码行数:20,代码来源:LineTests.cs


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