# Generating random coordinates (3D) with constraint

I have been trying to generate random $(x,y,z)$ coordinates (i.e. for 15 ellipsoids) so that they obey following constraints:

• ellipsoid's length is constant,
• ellipsoids do not intersect (fulfilled even when they are tilted),
• $z$ can be adjustable, means that random coordinates can be generated 2D $(x,y)$ or 3D $(x,y,z)$,

however, it appeared as a tough task. I know how to generate 15 random ellipsoids but I do not know how to impose the constraints.

• Similar problem, but not equal: mathematica.stackexchange.com/q/159484. – Henrik Schumacher Aug 23 '18 at 14:20
• Also related: stackoverflow.com/q/6300640. – Henrik Schumacher Aug 23 '18 at 15:26
• Are the ellipsoids at arbitrary angles? If so, you may need to simply define a sphere having radius the maximum radius of each ellipsoid, then use traditional sphere-packing algorithms. – David G. Stork Aug 23 '18 at 16:42
• I think you should probably consider acceptance/rejection methods. E.g. 1) generate a random set of ellipsoids 2) If they meet your constraints, accept them, otherwise reject them and try again – mikado Aug 23 '18 at 18:19
• Do the ellipsoids happen to be rotationally symmetric? – Henrik Schumacher Aug 23 '18 at 20:28