本文整理汇总了C#中Line.SmallestAngleBetween方法的典型用法代码示例。如果您正苦于以下问题:C# Line.SmallestAngleBetween方法的具体用法?C# Line.SmallestAngleBetween怎么用?C# Line.SmallestAngleBetween使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Line
的用法示例。
在下文中一共展示了Line.SmallestAngleBetween方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Line_SmallestAngleBetween_IntersectAtOrigin
public void Line_SmallestAngleBetween_IntersectAtOrigin()
{
Point basePointLine1 = Point.Origin;
Point basePointLine2 = Point.Origin;
Line line1 = new Line(basePointLine1, Point.MakePointWithInches(1, 1, 1));
Line line2 = new Line(basePointLine2, Point.MakePointWithInches(0, 0, 1));
double angleBetweenLinesInRadians = Math.Acos(1 / Math.Sqrt(3));
Angle angleBetweenLines = new Angle(new Radian(), angleBetweenLinesInRadians);
line1.SmallestAngleBetween(line2).Should().Be(angleBetweenLines);
}
示例2: Line_SmallestAngleBetween_Perpendicular
public void Line_SmallestAngleBetween_Perpendicular()
{
Point basePointLine1 = Point.Origin;
Point basePointLine2 = Point.Origin;
Line line1 = new Line(basePointLine1, Point.MakePointWithInches(1, 0, 0));
Line line2 = new Line(basePointLine2, Point.MakePointWithInches(0, 0, 1));
double angleBetweenLinesInRadians = Math.Acos(0);
Angle angleBetweenLines = new Angle(new Radian(), angleBetweenLinesInRadians);
line1.SmallestAngleBetween(line2).Should().Be(angleBetweenLines);
}
示例3: Line_SmallestAngleBetween_Millimeters
public void Line_SmallestAngleBetween_Millimeters()
{
Point basePointLine1 = Point.MakePointWithInches(2, 1, 0);
Point basePointLine2 = Point.MakePointWithInches(2, 4, 0);
Line line1 = new Line(basePointLine1, Point.MakePointWithInches(-2, 4, 3));
Line line2 = new Line(basePointLine2, Point.MakePointWithInches(-2, 1, 3));
Angle expectedResult = new Angle(new Radian(), 1.080839);
Angle actualResult = line1.SmallestAngleBetween(line2);
actualResult.Should().Be(expectedResult);
}