本文整理汇总了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();
}
示例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();
}