本文整理匯總了C#中System.Drawing.PointF.Distance方法的典型用法代碼示例。如果您正苦於以下問題:C# PointF.Distance方法的具體用法?C# PointF.Distance怎麽用?C# PointF.Distance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Drawing.PointF
的用法示例。
在下文中一共展示了PointF.Distance方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Contains
public override bool Contains(PointF pnt)
{
float r = Radius, s = pnt.Distance(GetCenter());
return s <= r;
}
示例2: DistanceTo2
public override float DistanceTo2(PointF pnt)
{
var cnt = GetCenter();
return pnt.DistancePow2(cnt) - 2 * pnt.Distance(cnt) * Radius + Radius * Radius;
}
示例3: GetDistance
public double GetDistance()
{
GenericPointViewModel genericPoint1 = CanvasChildren[0];
GenericPointViewModel genericPoint2 = CanvasChildren[1];
PointF relativePoint1 = new PointF((float)genericPoint1.XRatio * Image.Width, (float)genericPoint1.YRatio * Image.Height);
PointF relativePoint2 = new PointF((float)genericPoint2.XRatio * Image.Width, (float)genericPoint2.YRatio * Image.Height);
double dist = relativePoint1.Distance(relativePoint2);
return dist;
}
示例4: DistanceTo
public override float DistanceTo(PointF pnt)
{
return pnt.Distance(GetCenter()) - Radius;
}
示例5: DistanceTest
public void DistanceTest(double x1, double y1, double x2, double y2) {
Assert.AreEqual(x2.Hypot2(y2), MathTool.Distance(x1, y1, x2, y2), 0.000000001d);
var p1 = new PointF((float)x1, (float)y1);
var p2 = new PointF((float)x2, (float)y2);
Assert.AreEqual(x2.Hypot2(y2), p1.Distance(p2), 0.000000001d);
}