I have a file with the atomic coordinates $(x, y, z)$ of each atom on a two-dimensional sheet. In the case of graphene, the atoms have a distance of approximately 1.42 angstroms.
The sheet is usually along the $x$ and $y$-axes.
My need is to transform the coordinates of the sheet atoms into archimedean spiral-shaped coordinates (usually $r = a + b\theta$).
I found in an article a program that performs this task and that performs the following transformation:
$ x_i' = \bigg( \sqrt{2s(x_i+s_0)} + z_i \bigg) \cdot\cos\bigg(\sqrt{\dfrac{2(x_i+s_0)}{s}} \bigg ) $
$ y_i' = \bigg( \sqrt{2s(x_i+s_0)} + z_i \bigg) \cdot\sin\bigg(\sqrt{\dfrac{2(x_i+s_0)}{s}} \bigg ) $
$ z_i' = -y_i $
where $s$ is the distance between two consecutive layers of the spiral, and $s_0 = r_0^2/2$ (which I didn't understand where it came from), being $r_0$ the internal radius of the spiral. In any case, this transformation alters the atomic distances, which cause the chemical bonds between the atoms to be taken into account. The images below are from the input to the script I am making and the output of the program according to the transformation above, in regards to the positioning of the axes everything is working well, the problem is that it alters the distances between the atoms. It can be seen in the output image that most of them I'm not with their respective covalent bonds.

