PasteRack.org
Paste # 66732
2018-05-19 23:30:07

Fork as a new paste.

Paste viewed 269 times.


Embed:

  1. #lang racket
  2. (require plot)
  3. (require math)
  4.  
  5. (define id:output (plot (polar (lambda (theta) (* 2 (- 1 (cos(theta)))))
  6.                                0 (* 2 (pi))
  7.                                #:x-min -5 #:x-max 5
  8.                                #:y-min -5 #:y-max 5)))
  9.  
  10. (is-a? id:output image-snip%)
  11. (define id:bitmap (send id:output get-bitmap))
  12. (send id:bitmap save-file "2-4-2.png" 'png)

=>