(Edit: I need to revise this question with my original intent. Pls do not answer it yet. Thanks.)
Given the regular $n$-gon formed by the $n$-th roots of unity. For some $n$, how do we find $\sqrt{n}$ using the sum/difference of line segments?
$n=5:$
It is enough to use one line segment: If $x^5=1$, then it can be the distance between the root $x_0$ on the real line, and $x_2$ in the second quadrant,
$$1+\sqrt{\big(1+\cos\big(\tfrac{4\pi}{5}\big)\big)^2+\big(\sin\big(\tfrac{4\pi}{5}\big)\big)^2}=\frac{1+\sqrt{5}}{2}\tag1$$
$n=17:$
I observed that using the sum/difference of four line segments would do. Define,
$$L(\alpha,\beta)=\sqrt{\left(\cos\big(\tfrac{2\pi\,\alpha}{17}\big)+\cos\big(\tfrac{2\pi \,\beta}{17}\big)\right)^2+\left(\sin\big(\tfrac{2\pi\,\alpha}{17}\big)-\sin\big(\tfrac{2\pi \,\beta}{17}\big)\right)^2}$$
then,
$$L(0,3)-L(1,5)+L(3,7)+L(4,8)=\frac{1+\sqrt{17}}{2}\tag2$$
$n=257:$
$$???\tag3$$
Questions:
- Is there an alternative to $(2)$ that is purely a sum of positive values?
- How do we find $(3)$? (I assume it needs $64$ line segments.)

If $p\equiv1\bmod4$, then $\sum_0^{p-1}e^{2\pi ia^2/p}=\sqrt p$.
And if $p≡3$ mod $4$ the right side of the sum equality is just $i\sqrt{p}$. Such sums, for either caae, are called Gauss sums.
For example in a regular hendecagon with vertices numbered 0 through 10 in rotational order, the Gauss sum shows that the distances from vertex $k$ to $11−k$, with $k$ nonzero and a negative sign attached for $k=2$, gives $\sqrt{11}$ times the circumradius.