In this example, if all sides are 10mm long and I did not know that the distance between the parallel lines was 17.321 what formula could be used to get that number?

In this example, if all sides are 10mm long and I did not know that the distance between the parallel lines was 17.321 what formula could be used to get that number?

Copyright © 2021 JogjaFile Inc.
For regular polygons with constant side length $s$ and with $n \ge 3$, if you want the length of the line segment between alternate vertices - that is, skipping one vertex in the middle (which seems to be what you're asking), the formula is $L = 2s \cos \frac{\pi} n$, where the angle is specified in radian measure. To change to degrees, just replace the $\pi$ with $180^{\circ}$.
For the case $n=6$ (a regular hexagon) like in your figure, you'll get $2(10)\cos \frac{\pi} 6 = 10\sqrt 3 \approx 17.3205$.
Proving the formula is simple. The internal angle of a regular polygon can easily be shown to be $\frac{(n-2)\pi} {n} $ by any number of elementary methods such as triangular decomposition or computing the external angles first. If you bisect this angle you get a right triangle with hypotenuse $s$, giving you half the required length you want to find using simple right triangle trigonometry as $s \sin \frac{(n-2)\pi} {2n} $, which can be simplified by a trigonometric identity to $s \cos \frac{\pi} n$. Then the required length $L$ is simply double this, i.e. $L= 2s \cos \frac{\pi} n$.