Patterns

Pattern 0
This pattern was made in Cairo 2011-08-30 while finishing our first larger project in Small World Interactive. include Math

def svin(x) return sin(x)*0.5+0.5 end

puts "P3\n#{800} #{800}\n255"

(0...800).each{|py| s="" (0...800).each{|px|

x=(px-400)/400.0 y=(py-400)/400.0

ra=x*x+y*y a=atan2(y,x) r=svin((ra+svin(a*25))*23)*255 g=svin((ra+svin(a*26))*22)*255 b=svin((ra+svin(a*27))*21)*255 s+="#{r.to_i} #{g.to_i)} #{b.to_i} "

} puts s }