本文整理匯總了C#中System.Edge.ComputeIntersection方法的典型用法代碼示例。如果您正苦於以下問題:C# Edge.ComputeIntersection方法的具體用法?C# Edge.ComputeIntersection怎麽用?C# Edge.ComputeIntersection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Edge
的用法示例。
在下文中一共展示了Edge.ComputeIntersection方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TestEdgeIntersection
public void TestEdgeIntersection()
{
Edge edge;
Point p1, p2, intersection;
bool result;
object[,] tests = { {4.0, 4.0, 6.0, 2.0, false, 0.0, 0.0},
{0.0, 2.0, 6.0, -1.0, true, 2.0, 1.0},
{0.0, 2.0, 6.0, 2.0, true, 4.0, 2.0},
{6.0, -1.0, 2.0, -3.0, false, 0.0, 0.0} };
edge = new Edge(0, 0, 4, 2);
for (int i = 0; i < tests.GetLength(0); i++)
{
p1 = new Point((double)tests[i, 0], (double)tests[i, 1]);
p2 = new Point((double)tests[i, 2], (double)tests[i, 3]);
result = edge.ComputeIntersection(new Edge(p1, p2), out intersection);
Assert.Equals(result, tests[i, 4]);
if (result)
{
p1 = new Point((double)tests[i, 5], (double)tests[i, 6]);
Assert.Equals(p1.X, intersection.X);
Assert.Equals(p1.Y, intersection.Y);
}
}
}