# How to calculate all rays inside a sphere which are all equally angled from eachother

I am creating a 3D computer simulation and I want to build a sphere from rays coming from the center of the sphere. Imagine a sphere consisting of all dots/particles at the end of the rays.

The dots at the end should all cover about the same area (errors are acceptable if there is no perfect solution for this and the forms of the dots are not important).

I am not the best mathematician. In 2D I would just divide my circle's 360 degrees into N angles and it would be done. But I need it to be a 3D sphere.

So how can I find out all (almost?) equally divided spherical angles which are all n degrees apart in all directions?

Edit: I forgot to mention that I want to put small 3D objects at the end of every point on the 'dots' at the end of the lines. Those 3D objects should be oriented correctly so they fit on the line. If the solution doesn't give me exact angles, how do I calculate the rotation matrix for these objects?

(1) You could use the vertices of a geodesic dome:

(2) Otherwise you could use the centers of the best packings of disks on a sphere. See this earlier MO question: Distributing points evenly on a sphere.

• Or this solution: mathworld.wolfram.com/SpherePointPicking.html – David G. Stork Jul 24 '17 at 21:35
• This may be good enough for the desired application. What is being requested is more like point charge distribution or disk packing on a spherical surface. There are websites aplenty which address this situation. Gerhard "Try Searching Spherical Charge Distribution" Paseman, 2017.07.24. – Gerhard Paseman Jul 24 '17 at 21:37
• @GerhardPaseman: Yes, the Thompson problem. – Joseph O'Rourke Jul 24 '17 at 21:49
• I was already trying with a more-than-once subdivided icosahedron which I believe gives me a geodesic dome, but then I have a new problem because at the end of the lines I want to put small 3D objects and they must be oriented outwards. How do I calculate the rotation matrix for these objects? (I'll update my OP) – scippie Jul 25 '17 at 7:07
• Solved it. Used look-at calculations and now my sphere looks great! – scippie Jul 25 '17 at 11:18

You may also check partitions of the unit sphere into regions of equal area and small diameter by Paul Leopardi and use the centers of the largest empty circles inside the generated regions as an approximate solution.

• I saw that document but I noticed how the dots were not distributed evenly in the image which is not what I need. – scippie Jul 25 '17 at 12:10