Measure the uniformity of distribution of points in a 2D square I have a 2D square, and I have a set of points inside it, say, 1000 points. I need a way to see if the distribution of points inside the square are spread out (or more or less uniformly distributed) or are they tending to gather together in some spot inside the square.
I need a mathematical/statistical (not programming) way to determine this. I googled, found something like goodness of fit, Kolmogorov, etc., and just wonder if there are other approaches to achieve this. Need this for class paper.
Inputs: a 2D square, and 1000 points. Output: yes/no (yes = evenly spread out, no = gathering together in some spots).
 A: I think @John 's idea of a chi=square test is one way to go. 
You would want patches on 2-d, but you would want to test them using a 1 way chi-square test; that is, the expected values for the cells would be $\frac{1000}{N}$ where N is the number of cells. 
But it's possible that different number of cells would give different conclusions. 
Another possibility is to compute the average distance between points and then compare this to simulated results of that average. That avoids the problem of an arbitrary number of cells. 
EDIT (more on average distance)
With 1000 points, there are $\frac{1000*999}{2}$ pairwise distances between points. These can each be computed (using, say, Euclidean distance). These distances can be averaged.
Then you can generate N (a large number) of sets of 1000 points that are uniformly distributed. Each of those N sets also has an average distance among points.
Compare the results for the actual points to the simulated points, either to get a p-value or just to see where they fall.  
A: Another possibility is a Chi-Squared test. Divide the square into equally sized non-overlapping patches, and and test the counts of the points falling into the patches against their expected counts under a hypothesis of uniformity (the expectation for a patch is total_points / total_patches if they're all equally sized), and apply the chi-squared test. For 1000 points 9 patches should be sufficient, but you may want to use more granularity depending on what your data look like.
A: Why not use the Kolmogorov-Smirnov test? That's what I would do, especially considering that your sample size is big enough to compensate for the lack of power.
Alternatively, you could do some simulation. It's not rigorous, but it provides some evidence as to whether the data are uniformly distributed. 

@whuber The 2-dimensional extension of the KS is well known (see here). In this case, we are investigating whether these 1000 draws (coordinates (x,y)) could be drawn from the 2-dimensional jointly uniform distribution - at least that's how I read "evenly spread out". 
@John I might've expressed myself clumsily (neither maths nor English are my first languages). What I meant was that the exact p-value can be computed using a test such as the KS, whereas the p-value (or whatever you call the equivalent) only tends asymptotically when doing simulations. 
