This geometric spiral looks complicated, but it's fairly simple to draw; take the following box:
Draw a straight line between the corner of the box and some set distance above the next corner counter-clockwise.
Continue this pattern inward, always staying that set distance away from the corner of the next line. Here's a few more lines in.
As you can see, as the pattern continues, the spiral approaches the center and the boxes you draw begin to rotate. Note that the distance remains constant, regardless of angle.
The Challenge
The Inspiration (and also thanks to the wonderful person who introduced me to this concept <3)
Given a numerical (possibly fractional) input from 1 to 25, write an image to disk that uses this pattern or display the output on the screen, where the distance from each corner is the distance of one initial side of the box divided by the input. Continue the pattern inward until the distance from the corner specified is longer than the length of the next side.
Rules
- You may not use built-ins for this spiral creation, but you may use image processing builtins.
- If you write to disk, you must output an image in any of .jpg, .gif, .tiff, .pbm, .ppm, and .png.
- The initial side length must be at least 500 pixels.
- The initial corner may be whichever you choose.
- As always, the Standard Loopholes are disallowed.