Draw a Golden Spiral! Given a number n, you must output a golden spiral with the number of quarter turns being n.

The spiral must be completely black and the background must be completely white. This must be output as a φ⌊n/4⌋*4 by φ⌊n/4⌋*4 PNG file (you may output a PPM and convert it later). The shortest code wins.

The radius of the smallest quarter turn should be φ-3.

In geometry, a golden spiral is a logarithmic spiral whose growth factor is φ, the golden ratio.That is, a golden spiral gets wider (or further from its origin) by a factor of φ for every quarter turn it makes.
Mathematica, 169 bytes

All those annoying options. :(

f=Export[p=GoldenRatio;"a.png",ParametricPlot[p^(2t-3){Cos[a=t*Pi],Sin@a},{t,0,#/2},PlotRange-&gt;{r={m=-p^(#-3),-m},r},PlotStyle-&gt;Black,Axes-&gt;1&lt;0,ImageSize-&gt;p^#~Floor~4]]&amp;


This function saves the spiral to a.png in wherever your current working directory is.

The result of f[9]:



The result of f[12]:



I hope I understood all the bits about the scaling correctly.

There's not a whole lot to say about the code. I'm using ParametricPlot to draw curve as a parameterised function in t which advances by 1/2 for each quarter turn. The rest is done in the options:


PlotRange-&gt;{r={m=-p^(#-3),-m},r} makes sure we have an square aspect ratio which just covers the outermost point of the spiral.
PlotStyle-&gt;Black overwrites Mathematica's blue default colour.
Axes-&gt;1&lt;0 is just Axes-&gt;False (and turns off the axes, who knew!).
ImageSize-&gt;p^#~Floor~4 sets the correct dimensions in pixels, by noticing that ⌊n/4⌋*4 just means "n rounded down to the nearest multiple of 4".