Spreading points on a disc and on a sphere
When working with computer graphics, machine vision or simulations of various kind, two problems (among many others) which keep popping out are
- How to have N points approximately evenly distributed over a disc
- How to have N points approximately evenly distributed over a sphere
One way to build a solution for those two problems is to rely on a particle
system. Each point is a particle, particles are repulsing each other with
a

Spirals
There are much simpler and leaner algorithms to evenly distribute N points over a disc or a sphere, if one can live with just a good approximation. The main idea fits in one word : spiral ! Let's start with a disc. Imagine a spiral of dots starting from the center of the disc. In polar coordinates, the N points are produced by the sequence

What about the ideal

Vogel's method is dead simple to implement. In pure, barebone Python, it can be done like this
import math
n = 256
golden_angle = math.pi * (3 - math.sqrt(5))
points = []
for i in xrange(n):
theta = i * golden_angle
r = math.sqrt(i) / math.sqrt(n)
points.append((r * math.cos(theta), r * math.sin(theta)))
Using numpy, one can use vector operations like this
import numpy
n = 256
radius = numpy.sqrt(numpy.arange(n) / float(n))
golden_angle = numpy.pi * (3 - numpy.sqrt(5))
theta = golden_angle * numpy.arange(n)
points = radius[:,None] * numpy.stack([numpy.cos(theta), numpy.sin(theta)])
Spheres
What about the sphere ? We can reuse the golden angle spiral trick. In cylindrical coordinates, we would generate N points like this
And voila, an extremely cheap method to spread point evenly over a sphere's surface ! The code for this method is very close to the one for Vogel's method.
n = 256
golden_angle = numpy.pi * (3 - numpy.sqrt(5))
theta = golden_angle * numpy.arange(n)
z = numpy.linspace(1. - 1. / n, 1. / n - 1., n)
radius = numpy.sqrt(1. - z ** 2)
points = numpy.stack([radius * numpy.cos(theta),
radius * numpy.sin(theta),
z], axis = 1)
Note that you can also use this method to make a sphere mesh. The sphere will look good even with few polygons, but the indexing and computing the normals won't be especially fast. For this specific problem, making a sphere mesh, Iñigo Quilez have a very nice, efficient method introduced here.

I made ready-to-use Python functions on Github for the disc and the sphere.