Skip to content

Instantly share code, notes, and snippets.

@nasser
Created May 8, 2011 02:37
Show Gist options
  • Save nasser/961049 to your computer and use it in GitHub Desktop.
Save nasser/961049 to your computer and use it in GitHub Desktop.
# http://www.openprocessing.org/visuals/?visualID=2097
s = 500
x0, y0 = 0.0, 0.0
setup do
alpha_blending true
background :black
color :white, 100
end
draw do
n = 100000
# parameters from http://paulbourke.net/fractals/peterdejong/
a = 2
b = -2.53
c = 1.61
d = -0.33
# http://nodebox.net/code/index.php/shared_2008-02-29-18-05-38
translate width/2, height/2
scale 0.5
for i in 0..n
x1 = sin(a*y0) - cos(b*x0)
y1 = sin(c*x0) - cos(d*y0)
point x1*s, y1*-s
x0, y0 = x1, y1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment