# Need help maximizing distances to nearest neighbor in a cylinder

I have a cylinder and I want to maximize the number of points in the cylinder such that the distances to the nearest neighbors are maximally spaced. How do I find out how many points I can have so they are X distance apart?

Specific Ex. I have a cylinder of hight 20m and base radius of 10m. What is the maximum number of points I can have in the cylinder such that they are all at least 10m apart from the nearest neighbor?

Does it matter if it is a cylinder vs. any area with some height?

What is a formula for this?

• You are more likely to get some help if you explain why you need this. It is exceedingly improbable that there is a closed-form formula, and given the nature of the forum (it is for research mathematicians) it is even more unlikely that someone will do coding for you. (And yes, the shape will matter.) – Boris Bukh Sep 20 '16 at 17:20
• Points in the cylinder or on the cylinder? – Rodrigo de Azevedo Sep 20 '16 at 17:22
• This is for points in the cylinder – user98725 Sep 20 '16 at 17:30
• Perhaps you should explore packing spheres into a cylinder. E.g., see this MO question: Optimal fitting of spheres in a cylinder. If your cylinder has radius $R$, and the max separation achievable is $2r$, then the centers determine spheres packed in a cylinder of radius $R+r$. – Joseph O'Rourke Sep 20 '16 at 18:04
• That is not exactly what I am looking for. What if this was for a cube instead of a cylinder, would that be easier? – user98725 Sep 20 '16 at 20:36

The green cylinder $C$ has radius $R=2$ and height $h=4 \sqrt{2/3} \approx 3.26$. $C$ contains $17$ points, centers of spheres each of radius $r=1$. The points are at least $2r=2$ apart. The spheres fit inside a cylinder $C'$ of radius $R+r=3$.