5 comments

[ 4.3 ms ] story [ 18.8 ms ] thread
Is there any advantage to using SQL or PostgreSQL here or this one of those "just to show we can" exercises.
I'd say it's more a "because we can", but isn't it interesting anyway? Exposure to new ideas, or new ways to implement existing ideas, is usually interesting.
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.

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