Difference between revisions of "Sierpinski Assignment"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
− | =Racket Image Library= | + | =Code To Investigate= |
+ | ==Racket Image Library== | ||
[https://docs.racket-lang.org/teachpack/2htdpimage.html Racket Image Library Documentation] | [https://docs.racket-lang.org/teachpack/2htdpimage.html Racket Image Library Documentation] | ||
− | ==placement== | + | ===placement=== |
: [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._beside%29%29 beside] | : [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._beside%29%29 beside] | ||
: [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._above%29%29 above] | : [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._above%29%29 above] | ||
: [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._overlay%29%29 overlay] [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._overlay%2Falign%29%29 overlay/align] | : [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._overlay%29%29 overlay] [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._overlay%2Falign%29%29 overlay/align] | ||
: [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._rotate%29%29 rotate] | : [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._rotate%29%29 rotate] | ||
− | ==shapes== | + | ===shapes=== |
: [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._triangle%29%29 triangle] | : [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._triangle%29%29 triangle] | ||
: [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._circle%29%29 circle] | : [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._circle%29%29 circle] | ||
Line 12: | Line 13: | ||
: [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._rectangle%29%29 rectangle] | : [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._rectangle%29%29 rectangle] | ||
: [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._frame%29%29 frame] | : [https://docs.racket-lang.org/teachpack/2htdpimage.html#%28def._%28%28lib._2htdp%2Fimage..rkt%29._frame%29%29 frame] | ||
+ | ==Spacer== | ||
+ | <nowiki>; fully transparent rectangle | ||
+ | (define (spacer-rect w h) | ||
+ | (rectangle w h "outline" (color 0 0 0 0))) | ||
+ | ; fully transparent image the size of img | ||
+ | (define (spacer-image img) | ||
+ | (spacer-rect (image-width img) (image-height img)))</nowiki> | ||
=Sierpiński= | =Sierpiński= | ||
==Triangle== | ==Triangle== |
Revision as of 06:12, 15 March 2020
Contents
Code To Investigate
Racket Image Library
Racket Image Library Documentation
placement
shapes
Spacer
; fully transparent rectangle (define (spacer-rect w h) (rectangle w h "outline" (color 0 0 0 0))) ; fully transparent image the size of img (define (spacer-image img) (spacer-rect (image-width img) (image-height img)))
Sierpiński
Triangle
(define (sierpinski-triangle side-length n) (raise 'not-yet-implemented #t))
![]() |
![]() |
![]() |
![]() |
![]() |
n=0 | n=1 | n=2 | n=3 | n=4 |
Carpet
(define (sierpinski-carpet side-length n) (raise 'not-yet-implemented #t))
![]() |
![]() |
![]() |
![]() |
![]() |
n=0 | n=1 | n=2 | n=3 | n=4 |
Cantor
Stool
(define (cantor-stool width height n) (raise 'not-yet-implemented #t))
![]() |
![]() |
![]() |
![]() |
![]() |
n=0 | n=1 | n=2 | n=3 | n=4 |