interference.cs 651 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /rot { 3 -1 roll } def
  2. /2dup { 2 copy } def
  3. /circle { % context radius -- context
  4. 2dup 0 m pop
  5. 0 0 rot 0 math.2pi arc h
  6. } def
  7. /circles { % context #circles -- context
  8. 1 1 rot { circle } for
  9. } def
  10. /SIDE 600. def
  11. /SIZE 600. def
  12. << /width SIZE /height SIZE >> surface context
  13. 1 1 1 set-source-rgb paint
  14. 0 0 0 set-source-rgb
  15. //EVEN_ODD set-fill-rule
  16. /r 4 def
  17. /n SIDE 1.5 mul r div integer def
  18. SIZE SIDE div dup scale
  19. save
  20. 302 200 translate
  21. r dup scale
  22. n circles
  23. restore
  24. save
  25. 100 300 translate
  26. r dup scale
  27. n circles
  28. restore
  29. save
  30. 500 400 translate
  31. r dup scale
  32. n circles
  33. restore
  34. fill
  35. /target get (out.png) write-to-png pop
  36. pop