There are illustrations for the spiral copy problem with a constant time complexity. See video about this: https://youtu.be/PDQRn3KDmMc Now, you can see the spiralCordinates function here: (illustrations/js/tools.js)