[Math] How to effectively distribute points on plane

algorithmsgeometry

I have a plane (screen) with its width and height (monitor resolution, not square). And I'd like to distribute points on that plane with the (approximately) same distance from each other.

For example:

  • 1 point will be in the middle,
  • 2 points will be in the middle of y axis, and x axis will be divided by 3
  • 3 points may be like triangle, but if sceen is wide enough, thay can be alighned in same y
  • 4 like second part of above, or as rectangle..
  • etc to 8 points max

Is there any algorithm for this?

Thank you for your time!

EDIT: same distance from each other and from plane border

EDIT2: I compute centers of mass for groups of objects on which behavior I simulate on plane.

Best Answer

The question is a bit vague, but the first idea that came to my mind would be to use a low-discrepancy sequence such as a Halton sequence or a Sobol sequence. Here are examples of 256 points distributed on the plane using each of them, with a random distribution for comparison:

Halton sequence Sobol sequence Random sequence
From left to right: Halton sequence, Sobol sequence, random sequence. Images by Jheald / Wikimedia Commons, licensed under the CC-By-SA 3.0 license.

At least, you could use these sequences as starting configurations for a local optimization algorithm, which might e.g. repeatedly move each point a small distance away from its nearest neighbor until the configuration stabilizes.