本文整理汇总了C#中System.Line.IsHorizontal方法的典型用法代码示例。如果您正苦于以下问题:C# Line.IsHorizontal方法的具体用法?C# Line.IsHorizontal怎么用?C# Line.IsHorizontal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Line
的用法示例。
在下文中一共展示了Line.IsHorizontal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HorizontalConstraintShouldWork
public void HorizontalConstraintShouldWork()
{
var line = new Line(new Point(0, 1, false), new Point(2, 3, false, true) );
var error = SketchSolve.Solver.solve
(true
, line.IsHorizontal()
);
error.Should ().BeApproximately (0, 0.0001);
line.p1.y.Value.Should().BeApproximately(line.p2.y.Value, 0.001);
}
示例2: TangentToCircleConstraintWithLineInitiallyHorizontalShouldWork
public void TangentToCircleConstraintWithLineInitiallyHorizontalShouldWork()
{
// Create a fully constrained circle at 0,0 with radius 1
var circle = new Circle() { center = new Point(0, 0, false), rad = new Parameter(10, false) };
var v = -15;
var line = new Line(new Point(-100, -v, false, true), new Point(100, -v*2.1, false, true));
var r = SketchSolve.Solver.solve
( true
, line.IsTangentTo(circle)
, line.IsHorizontal()
);
Console.WriteLine (line);
Console.WriteLine (circle);
(circle.CenterTo (line).Vector.LengthSquared - circle.rad.Value*circle.rad.Value)
.Should ()
.BeApproximately (0, 0.001);
}