[Math] Distributing points evenly between two fixed points

equidistributiongeometrytriangles

I have two fixed points, $P_1$ and $P_2$.
I am trying to distribute $n$ points between them, so that the distance between every point is equal.
This is easy when:

distance between points $\cdot (n-1) =$ distance between $P_1$ and $P_2$,

as they all follow the slope of the two fixed points, but I want to be able to increase the distance between them so that:

distance between points $\cdot (n-1) >$ distance between $P_1$ and $P_2$.

I have played around a lot with pythagorean methods, but I always seem to be one variable short.

Thanks for any help.

Best Answer

If I understand correctly, you want to have the same distance $d$ between consecutive points $p_1,q_1,q_2\dots,q_n,p_2$.

(1) One geometrically natural way to achieve this is to distribute the points uniformly on a circular arc with $p_1,p_2$ as endpoints. The center of the circle will be on the line that crosses the segment $p_1p_2$ in the middle and at the right angle. So it remains to find the radius $R$ of the circle. This requires trigonometry. Let $\alpha$ be the angle subtended by the chord $p_1p_2$. Then $$2R\sin\frac{\alpha}{2}=|p_1p_2|$$ The angle subtended by each of the other $n+1$ chords $p_1q_1$, $q_1q_2$... will be $$\beta=\frac{2\pi-\alpha}{n+1}$$ Finally, we want the length of the latter chords to be $d$, which means $$2R\sin\frac{\beta}{2}=d$$

Let's eliminate $\alpha$ via $\alpha=2\pi-(n+1)\beta$. Then we have the system $$ \begin{cases} 2R\sin((n+1)\beta/2)&=|p_1p_2| \\ 2R\sin (\beta/2) &=d \end{cases} $$ Now it's easy to eliminate $R$ by division, but solving the remaining equation for $\beta$ will probably require a numerical solution by a computer. Once you have $\beta$, you get $R$ from either equation.

(2) Another way, which is what you actually wanted, is to place the points in a zig-zag curve. Well, we still need trigonometry. Let $\alpha$ be the angle between the segment $p_1p_2$ and the new segments of length $d$. Then the projection of each new segment onto $p_1p_2$ has length $d\cos\alpha$. Since there are $(n+1)$ such projections and their sum is the distance $|p_1p_2|$, we conclude that $(n+1)d\cos\alpha=|p_1p_2|$. From here we find $$\alpha=\cos^{-1}\frac{|p_1p_2|}{d(n+1)}$$ and now the position of all points is determined. Starting from $p_1$, we know the angle and the distance to $q_1$, so we place $q_1$ there, and go on.