Generating vertices of regular n-sided polygons/polyhedra and circles/spheres

There are a number of applications that make use of circles, spheres, regular polygons and polyhedra. Most of them are in the area of computer graphics and most likely you are reading this because you'd like to know how are those objects generated in 3d modelling tools or perhaps in that awesome drawing library you ...