Disclaimer: | The solution that I obtained to this problem does not lend itself to providing a “real-time” calculator like the Christmas Tree Lights Spacing Calculator. A computer program was written, however, to obtain the solution and generate animations that illustrate the solution. |
These \(N\) spiral points \((x_i,y_i)\) are parameterized by \[ \begin{array}{rcl} x_i & = & \rho_i\cos(i\varphi)\\ y_i & = & \rho_i\sin(i\varphi) \end{array}\] where \(\displaystyle\varphi=\pi(3-\sqrt{5})\) is the Golden angle (in radians), \(\rho_\text{min}\) is the minimum radius where the points begin (e.g., \(\rho_\text{min}=r/100\)), and \[ \rho_i=\rho_\text{min} + (r-\rho_\text{min})\sqrt{\frac{i}{N-1}} \] with \(0\leq i\leq N-1\).
Now that the \(N\) ornaments have been lifted to the tree, I then made some adjustments to ensure even spacing. The first step is to insert an additional placeholder ornament at the top of the cone (to reserve space for the tree-topper). In order to keep ornaments from accumulating at the bottom of the cone, I also inserted N+1 additional placeholder ornaments onto a vertically reflected cone (resulting in a total of N ornaments and N+2 placeholder ornaments).
In order to recursively adjust each of the \(N\) ornaments, they are interpreted as electrons on a cone. Since like charges repel, the electrons will try to spread away from one another as much as possible. However, each electron cannot spread too far away because, otherwise, it will begin to approach another electron. The dispersion process nudges each electron in the direction of the net Coulomb force acting on it. The Coulomb force acting on the \(i^{\text{th}}\) ornament due to the \(j^{\text{th}}\) ornament \((j\neq i)\) is the force \[ \vec{f}_{\!i,j} = \frac{\vec{\Delta}_{i,j}}{\left\|\vec{\Delta}_{i,j}\right\|^3} \] where \[ \vec{\Delta}_{i,j} = \big\langle x_i-x_j,y_i-y_j,z_i-z_j\big\rangle, \] and thus the (total) net force acting on the \(i^{\text{th}}\) ornament by the other 2N+1 other ornaments is \[ \vec{F}_i = \sum_{\underset{\scriptstyle j\neq i}{j=1}}^{2N+2} \vec{f}_{\!i,j} \]
Each of the \(N\) ornaments are moved in the direction (and by an amount proportional to the magnitude) of \(\vec{F}_i\) (\(1\leq i\leq N\)), and then each ornament is projected back onto the cone. The animation below illustrates several iterations of this dispersion process (watch carefully).