

Drawing fractals with PostgreSQL - bacarter
http://explainextended.com/2013/12/31/happy-new-year-5/

======
Xophmeister
Blowing my own trumpet, somewhat, but here's my write up of creating the
Mandelbrot set in Oracle 11g (which I'm forced to use at work) SQL:

[http://xoph.co/20130917/mandelbrot-sql/](http://xoph.co/20130917/mandelbrot-
sql/)

------
penrod
I initially read the title as "Drawing fractals with PostScript," which is
also fun. Here's a fractal fern in ps:

/t0 [ .85 -.04 .04 .85 0 1.6 ] def /t1 [ .2 .23 -.26 .22 0 1.24] def /t2 [-.15
.26 .28 .24 0 0.44] def /t3 [0 0 0 .16 0 0 ] def

/rmax 2 31 exp def

/map {rand rmax div dup .81 lt {pop t0} {dup .90 lt {pop t1} {.99 lt {t2} {t3}
ifelse} ifelse} ifelse} def

/plot {2 copy .001 dup rectfill} def

290 50 translate 70 dup scale 0 0 2000000 {plot map transform} bind repeat
showpage

------
joe_the_user
Is there any advantage to using SQL or PostgreSQL here or this one of those
"just to show we can" exercises.

~~~
quassnoi
There is no advantage: the modern GPU can build thousands of full page
resolution fractals per second while SQL takes seconds to produce a hundred by
hundred characters ASCII art.

It's just a New Year SQL picture post, something I do every new year on my
blog.

