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


C# Line.Rotate方法代码示例

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


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

示例1: Line_Rotate_AboutReferencePoint

        public void Line_Rotate_AboutReferencePoint()
        {
            Point start = Point.MakePointWithInches(0, 1, 3);
            Point end = Point.MakePointWithInches(0, 1, 5);

            Line toRotate = new Line(start, end);
            Line startPointYAxis = new Line(start, Point.MakePointWithInches(0, 2, 3)); //relative y axis

            Angle rotationAngle = Angle.RightAngle;

            Line afterRotate = toRotate.Rotate(new Rotation(startPointYAxis, rotationAngle));

            Point expectedStart = new Point(start);
            Point expectedEnd = Point.MakePointWithInches(2, 1, 3);
            Line expectedResult = new Line(expectedStart, expectedEnd);

            (expectedResult == afterRotate).Should().BeTrue();
        }
开发者ID:ParagonTruss,项目名称:GeometryClassLibrary,代码行数:18,代码来源:LineTests.cs

示例2: Line_Rotate_AboutZAxis

        public void Line_Rotate_AboutZAxis()
        {
            Point basePointLine1 = Point.MakePointWithInches(2, 1, 0);
            Point otherPointLine1 = Point.MakePointWithInches(3, 3, 3);

            Line line1 = new Line(basePointLine1, otherPointLine1);
            Line axisLine = new Line(Point.Origin, Point.MakePointWithInches(0, 0, 1));

            Angle rotationAngle = new Angle(new Degree(), 199);

            Line actualResult = line1.Rotate(new Rotation(axisLine, rotationAngle));

            Point expectedResultBasePoint = Point.MakePointWithInches(-1.5654689967414768, -1.5966548845136304, 0.0);
            Direction expectedDirection = new Direction(Point.MakePointWithInches(-0.29438226668500322,-2.2166053056557904,3.0));
            Line expectedResult = new Line(expectedDirection, expectedResultBasePoint);

            (expectedResult == actualResult).Should().BeTrue();
        }
开发者ID:ParagonTruss,项目名称:GeometryClassLibrary,代码行数:18,代码来源:LineTests.cs


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