In computational geometry, the diameter of a finite set of points or of a polygon is its diameter as a set, the largest distance between any two points. The diameter is always attained by two points of the convex hull of the input. A trivial brute-force search can be used to find the diameter of n {\displaystyle n} points in time O ( n 2 ) {\displaystyle O(n^{2})} (assuming constant-time distance evaluations) but faster algorithms are possible for points in low dimensions.