Well it took longer tha expected. I had to decode the Arctan2 node, in order to modify it to calculate the angle from x-axis to a given point (in the range 0..2PI)
As you can see the render still contains shadow errors and som cut off on displacements.
(the rotation of the coordinates as described above, should be clockwise i.e. rotate the N'th segment to the first segment)