Hello,

I’m trying to find the least expensive way to determine the smallest radius of a circle that circumscribes a X number of points. The goal is to find for each vertex in a mesh the smallest radius that circumscribes a given number of points from a list of points. The list of points, the mesh and the number of points to be circumscribed are inputs.

One method is to measure the distance from the mesh vertex to every point in the list and sort of distances. The Nth-1 number on the list will be the desired radius. This is a very slow method. Any other ideas?

A working example is:

```
private void RunScript(List<Point3d> pts, Point3d refPt, int numPt, ref object A, ref object B)
{
List<double> dist = new List<double>();
foreach(Point3d pt in pts)
{
double d = Math.Sqrt((pt.X - refPt.X) * (pt.X - refPt.X) + (pt.Y - refPt.Y) * (pt.Y - refPt.Y));
dist.Add(d);
}
dist.Sort();
A = (dist[numPt] + dist[numPt - 1]) / 2;
}
```

Another option would be to increment the radius of a circle until the desired number of point is inside. But I’m having problems implementing this and I’m not sure it will be a faster method.