using System; using System.Linq; using System.Collections.Generic; using System.Threading; public class Test { public class DataPoint { public double X {get; set;} public double Y {get; set;} } public static void Main() { int count = 39; // generate our points List[] sets = new List[count]; double[] result = new double[count]; for(var i=0; i { result[idx] = GetAbsoluteMax(sets[idx]); if (Interlocked.Decrement(ref running) == 0) { resetEvent.Set(); } }), null ); } resetEvent.WaitOne(); } foreach(var max in result) { Console.WriteLine(max); } } public static double GetAbsoluteMax(List list) { double max = 0; // calc dist for each distinct pair Dist(P_1, P_2) == Dist(P_2, P_1) for(var i=0; i max) { max = dist; } } } return Math.Sqrt(max); } public static List GetRandomDataPoints(int size) { var result = new List(); var rnd = new Random(); for(var i=0; i