本文整理汇总了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);
}