This reminded me of my own first "brush" with Op art. It was in art class years ago, our professor (Madame Vitré) had asked that we recreate an interesting piece. The concept in itself was easy: pick two points and draw a number of lines through each of them. Where they intersect, the two sets of lines create a multitude of polygons that can be filled in black or white alternatively, for quite a dramatic result.
As you can imagine, it was tedious work on paper. Years later, I'd get a thrill at doing it in just a couple minutes using Paint on Windows. Well, here I am again in 2012, now a grown-up programmer:
The example above was run using P = 2, N = 30, and colors = c("black", "white"). And here is a nice series using three points and colors from the brewer palette:
P = 3, N = 12, colors = brewer.pal(3, "Reds") |
P = 3, N = 15, colors = brewer.pal(3, "Purples") |
P = 3, N = 15, colors = brewer.pal(3, "Blues") |
P = 3, N = 9, colors = brewer.pal(3, "Greens") |
Madame Vitré would be proud. (or horrified?)
Cool post, and a great reminder that sp* packages, functions, and classes can be used for all kind of fun this. Reminds me of some stuff I posted years ago:
ReplyDeletehttp://casoilresource.lawr.ucdavis.edu/drupal/node/878
http://casoilresource.lawr.ucdavis.edu/drupal/node/838
You Rtist. Love your post!!!
ReplyDeleteVery nice. Makes me wonder how mind-bending it would be to do something similar for a self-intersecting closed curve (maybe parameterised as some kind of 2D spline with random knots)
ReplyDeleteThis comment has been removed by the author.
ReplyDelete