本文整理汇总了C#中GeoLib.C2DPoint.GetMidPoint方法的典型用法代码示例。如果您正苦于以下问题:C# C2DPoint.GetMidPoint方法的具体用法?C# C2DPoint.GetMidPoint怎么用?C# C2DPoint.GetMidPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeoLib.C2DPoint
的用法示例。
在下文中一共展示了C2DPoint.GetMidPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetInCentre
/// <summary>
/// Static version of InCentre function.
/// </summary>
public static C2DPoint GetInCentre(C2DPoint pt1, C2DPoint pt2, C2DPoint pt3)
{
// Set up a line to bisect the lines from 1 to 2 and 1 to 3
C2DLine Line1 = new C2DLine(pt1, pt2);
C2DLine Line2 = new C2DLine(pt1, pt3);
Line1.SetLength( Line2.GetLength() );
C2DLine Line12Bisect = new C2DLine( pt1, pt3.GetMidPoint( Line1.GetPointTo()));
// Set up a line to bisect the lines from 2 to 1 and 2 to 3
C2DLine Line3 = new C2DLine(pt2, pt1);
C2DLine Line4 = new C2DLine(pt2, pt3);
Line3.SetLength( Line4.GetLength() );
C2DLine Line34Bisect = new C2DLine(pt2, pt3.GetMidPoint(Line3.GetPointTo()));
// Now intersect the 2 lines and find the point.
List<C2DPoint> Int = new List<C2DPoint>();
// Add the intersection even if there isn't one (i.e. infinite lines)
bool B1 = true, B2 = true;
Line12Bisect.Crosses(Line34Bisect, Int, ref B1, ref B2, true);
Debug.Assert (Int.Count == 1);
return Int[0];
}