2 added 762 characters in body edited Sep 17 '14 at 4:47 Dr. belisarius 108k1111 gold badges173173 silver badges390390 bronze badges diameter[x_List] := Max[EuclideanDistance @@@ Subsets[x, {2}]] diameter[pointset] (* 2 Sqrt[5] *)  Now, let's improve the performance "a little bit". I believe the maximal distance will be realized at the points' convex hull (I'll not demonstrate it,but it's quite intuitive). Now, if you have a lot of points Mathematica provides a convenient and fast way to find the Convex Hull. Let's use it and test the performance with and without it: << ComputationalGeometry pointset = RandomReal[{0, 1}, {3000, 2}]; diameter[x_List] := Max[EuclideanDistance @@@ Subsets[x, {2}]] Timing[diameter[pointset]] Timing[ch = ConvexHull@pointset; diameter[pointset[[ch]]]] (* {45.328125, 1.39892} {0.061250, 1.39892} *)  Now,YMMV but that's 45 vs .06 secs. Not bad at all for a little improvement ;) diameter[x_List] := Max[EuclideanDistance @@@ Subsets[x, {2}]] diameter[pointset] (* 2 Sqrt[5] *)  diameter[x_List] := Max[EuclideanDistance @@@ Subsets[x, {2}]] diameter[pointset] (* 2 Sqrt[5] *)  Now, let's improve the performance "a little bit". I believe the maximal distance will be realized at the points' convex hull (I'll not demonstrate it,but it's quite intuitive). Now, if you have a lot of points Mathematica provides a convenient and fast way to find the Convex Hull. Let's use it and test the performance with and without it: << ComputationalGeometry pointset = RandomReal[{0, 1}, {3000, 2}]; diameter[x_List] := Max[EuclideanDistance @@@ Subsets[x, {2}]] Timing[diameter[pointset]] Timing[ch = ConvexHull@pointset; diameter[pointset[[ch]]]] (* {45.328125, 1.39892} {0.061250, 1.39892} *)  Now,YMMV but that's 45 vs .06 secs. Not bad at all for a little improvement ;) 1 answered Sep 17 '14 at 1:52 Dr. belisarius 108k1111 gold badges173173 silver badges390390 bronze badges diameter[x_List] := Max[EuclideanDistance @@@ Subsets[x, {2}]] diameter[pointset] (* 2 Sqrt[5] *)