/// <summary> /// 连点之间距离公式判断坐标是否在圆内,√[(x1-x2)²+(y1-y2)²] /// </summary> /// <param name="p"></param> /// <param name="f"></param> /// <param name="r"></param> /// <returns></returns> public string inoutCircle(PointF p, PointF f, double r) { double distanceBetPoints;//两点之间距离 distanceBetPoints = Math.Pow(Math.Pow(p.X - f.X, 2) + Math.Pow(p.Y - f.Y, 2), 0.5); if (distanceBetPoints <= r) { return "in"; } else { return "out"; } }
原创文章,作者:端木书台,如若转载,请注明出处:https://blog.ytso.com/275369.html