From faf055c8580fe4eb2345919c1a622d865115913f Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sun, 8 Nov 2009 00:19:53 +0000 Subject: [PATCH] added circle and star-polygon svn: r16617 --- collects/2htdp/image.ss | 2 + collects/2htdp/private/image-more.ss | 35 ++++++++--- collects/mrlib/image-core.ss | 9 ++- .../teachpack/2htdp/scribblings/image.scrbl | 57 ++++++++++++++---- .../img/_circle_20__solid___blue__.png | Bin 0 -> 661 bytes .../img/_circle_30__outline___red__.png | Bin 0 -> 1542 bytes ...ygon_20_10_3__solid___cornflowerblue__.png | Bin 0 -> 1559 bytes ...tar-polygon_40_5_2__solid___seagreen__.png | Bin 0 -> 1615 bytes ...ar-polygon_40_7_3__outline___darkred__.png | Bin 0 -> 4423 bytes .../img/_star_40__solid___gray__.png | Bin 1517 -> 1264 bytes collects/tests/2htdp/test-image.ss | 14 ++++- 11 files changed, 93 insertions(+), 24 deletions(-) create mode 100644 collects/teachpack/2htdp/scribblings/img/_circle_20__solid___blue__.png create mode 100644 collects/teachpack/2htdp/scribblings/img/_circle_30__outline___red__.png create mode 100644 collects/teachpack/2htdp/scribblings/img/_star-polygon_20_10_3__solid___cornflowerblue__.png create mode 100644 collects/teachpack/2htdp/scribblings/img/_star-polygon_40_5_2__solid___seagreen__.png create mode 100644 collects/teachpack/2htdp/scribblings/img/_star-polygon_40_7_3__outline___darkred__.png diff --git a/collects/2htdp/image.ss b/collects/2htdp/image.ss index 3e1fe09bfc..b3390d3b06 100644 --- a/collects/2htdp/image.ss +++ b/collects/2htdp/image.ss @@ -64,10 +64,12 @@ and they all have good sample contracts. (It is amazing what we can do with kids scale scale/xy + circle ellipse rectangle regular-polygon star + star-polygon triangle x-place? diff --git a/collects/2htdp/private/image-more.ss b/collects/2htdp/private/image-more.ss index 58ce429211..9a38042193 100644 --- a/collects/2htdp/private/image-more.ss +++ b/collects/2htdp/private/image-more.ss @@ -18,9 +18,6 @@ frame - ellipse - rectangle - show-image save-image bring-between @@ -40,9 +37,14 @@ image-width image-height + circle + ellipse + rectangle + regular-polygon triangle star + star-polygon swizzle) @@ -190,7 +192,7 @@ (if (string? arg) (string->symbol arg) arg)] - [(width height) + [(width height radius) (check-arg fn-name (and (real? arg) (not (negative? arg))) @@ -621,11 +623,7 @@ (make-point 0 height))) -;; circle -;; ellipse -;; triangle ;; line -;; star ;; text (define/chk (triangle side-length mode color) @@ -635,6 +633,16 @@ (make-polygon/star side-length side-count mode color values)) (define/chk (star-polygon side-length side-count step-count mode color) + (check-arg 'star-polygon + (step-count . < . side-count) + (format "number that is smaller than the side-count (~a)" side-count) + 3 + step-count) + (check-arg 'star-polygon + (= 1 (gcd side-count step-count)) + (format "number that is relatively prime to the side-count (~a)" side-count) + 3 + step-count) (make-polygon/star side-length side-count mode color (λ (l) (swizzle l step-count)))) (define/chk (star side-length mode color) @@ -650,6 +658,11 @@ (make-bb (- r l) (- b t) (- b t)) #f)))) +(define (gcd a b) + (cond + [(zero? b) a] + [else (gcd b (modulo a b))])) + ;; swizzle : (listof X)[odd-length] -> (listof X) ;; returns a list with the same elements, ;; but reordered according to the step. Eg, if the step @@ -682,6 +695,12 @@ (make-bb width height height) #f)) +(define/chk (circle radius mode color) + (let ([w/h (* 2 radius)]) + (make-image (make-ellipse w/h w/h 0 mode color) + (make-bb w/h w/h w/h) + #f))) + (define (mode-color->pen mode color) (send the-pen-list find-or-create-pen color 1 (case mode diff --git a/collects/mrlib/image-core.ss b/collects/mrlib/image-core.ss index 20bbcedb4b..e5b1ce6d40 100644 --- a/collects/mrlib/image-core.ss +++ b/collects/mrlib/image-core.ss @@ -151,8 +151,11 @@ has been moved out). (null? p2-points)) (and (not (or (null? p1-points) (null? p2-points))) - (eq-recur (rotate-to-zero (closest-to-zero p1-points) p1-points) - (rotate-to-zero (closest-to-zero p2-points) p2-points))))))) + (or (eq-recur (rotate-to-zero (closest-to-zero p1-points) p1-points) + (rotate-to-zero (closest-to-zero p2-points) p2-points)) + (let ([p1-rev (reverse p1-points)]) + (eq-recur (rotate-to-zero (closest-to-zero p1-rev) p1-rev) + (rotate-to-zero (closest-to-zero p2-points) p2-points))))))))) (define (rotate-to-zero zero-p points) (let loop ([points points] @@ -412,7 +415,7 @@ has been moved out). (send path line-to (point-x (car points)) (point-y (car points))) (send dc set-pen (mode-color->pen (polygon-mode simple-shape) (polygon-color simple-shape))) (send dc set-brush (mode-color->brush (polygon-mode simple-shape) (polygon-color simple-shape))) - (send dc draw-path path dx dy))] + (send dc draw-path path dx dy 'winding))] [else (let ([dx (+ dx (translate-dx simple-shape))] [dy (+ dy (translate-dy simple-shape))] diff --git a/collects/teachpack/2htdp/scribblings/image.scrbl b/collects/teachpack/2htdp/scribblings/image.scrbl index 146adca8bc..55a7e0107c 100644 --- a/collects/teachpack/2htdp/scribblings/image.scrbl +++ b/collects/teachpack/2htdp/scribblings/image.scrbl @@ -23,7 +23,19 @@ Existing images can be rotated, scaled, and overlaid on top of each other. @section{Basic Images} -@defproc[(ellipse [width real?] [height real?] [mode mode?] [color (or/c symbol? string?)]) image?]{ +@defproc[(circle [radius (and/c real? positive?)] + [mode mode?] + [color (or/c symbol? string?)]) + image?]{ + Constructs a circle with the given radius, height, mode, and color. + + @image-examples[(circle 30 "outline" "red") + (circle 20 "solid" "blue")] + +} + + +@defproc[(ellipse [width (and/c real? positive?)] [height (and/c real? positive?)] [mode mode?] [color (or/c symbol? string?)]) image?]{ Constructs an ellipsis with the given width, height, mode, and color. @image-examples[(ellipse 40 20 "outline" "black") @@ -49,17 +61,6 @@ Existing images can be rotated, scaled, and overlaid on top of each other. (regular-polygon 20 6 "solid" "red")] } -@defproc[(star [side-length (and/c positive? real?)] - [mode mode?] - [color (or/c symbol? string?)]) - image?]{ - Constructs a star with five points. The @scheme[side-length] argument - determines the side length of the enclosing pentagon. - - @image-examples[(star 40 "solid" "gray")] - -} - @defproc[(triangle [side-length (and/c positive? real?)] [mode mode?] [color (or/c symbol? string?)]) @@ -72,6 +73,38 @@ Existing images can be rotated, scaled, and overlaid on top of each other. @image-examples[(triangle 40 "solid" "tan")] } +@defproc[(star [side-length (and/c real? positive?)] + [mode mode?] + [color (or/c symbol? string?)]) + image?]{ + Constructs a star with five points. The @scheme[side-length] argument + determines the side length of the enclosing pentagon. + + @image-examples[(star 40 "solid" "gray")] + +} + +@defproc[(star-polygon [side-length (and/c real? positive?)] + [side-count side-count?] + [step-count step-count?] + [mode mode?] + [color (or/c symbol? string?)]) + image?]{ + + Constructs an arbitrary regular star polygon (a generalization of the regular polygons). + The polygon is enclosed by a regular polygon with @scheme[side-count] sides each + @scheme[side-length] long. The polygon is actually constructed by going from vertex to + vertex around the regular polgon, but skipping over every @scheme[step-count] verticies. + + For examples, if @scheme[side-count] is @scheme[5] and @scheme[step-count] is @scheme[2], + then this function produces a shape just like @scheme[star]. + + @image-examples[(star-polygon 40 5 2 "solid" "seagreen") + (star-polygon 40 7 3 "outline" "darkred") + (star-polygon 20 10 3 "solid" "cornflowerblue")] + +} + @section{Overlaying Images} @defproc[(overlay [i1 image?] [i2 image?] [is image?] ...) image?]{ diff --git a/collects/teachpack/2htdp/scribblings/img/_circle_20__solid___blue__.png b/collects/teachpack/2htdp/scribblings/img/_circle_20__solid___blue__.png new file mode 100644 index 0000000000000000000000000000000000000000..8d9a9a112c6c69d14e1dade9bbbca52c651c63a9 GIT binary patch literal 661 zcmV;G0&4w+AqTO{82i;t&_yt6Cw4j0?z`?<-iXbAk zlT*PVNNGhV7^;;d=NPi(Os)*}l4>5H{KXW3gIxKF`5HdtrcXH)Z*oy|-sOTHR@OgatWay7@!xr=<|`J=;?vq@AOU2&jWxcT{)RZ1OPzt`r6S4J~UK0w~UQBXP=x@+NY-u!K0(p zv`Smk7!2AD3&GplS~K$99a~!LwYRr_n9oV>?AQoTPgftzs?S7AOSZtlAaglZrTQ$G z&vRzRVt8`$|8UsACi(HfaM&_D}xfbY(*%!nOP(00000NkvXXu0mjfuBALY literal 0 HcmV?d00001 diff --git a/collects/teachpack/2htdp/scribblings/img/_circle_30__outline___red__.png b/collects/teachpack/2htdp/scribblings/img/_circle_30__outline___red__.png new file mode 100644 index 0000000000000000000000000000000000000000..0dd50084e16436991abdf220af1292bbe8063ea2 GIT binary patch literal 1542 zcmV+h2Ko7kP)*7bZ=DpC6`7!Mu404Mli3OeUC22nZO}Ljj)=db?aG zF2?QKC@h4(KjPxBY#BmAU@$bcd>-dR}$`0CXdYsul;H%3MAzyS|UhVahJq`|fi?ZT zfBxjcg}i=!e5_xrU`NN_fsVH4;}yz@c1#-tWjG>HY-=6vJy_G0Gkcr;cDy1X6jVL#-g-Tz=sbA3sYN135yn? zrba+r9p=wh+eHaWmY}*?fXfAqMr{`*EMAPaZw0vB@bgpKMG1j{`0_amUySw4%C;UD&oj^Do2nZ11=ZCH?wOy28w?n5B5FCv9dbM4YV7DVENPxkB z+FG?;lwdYv@nQk<=AofMZ5Jg}RUtA`Ky)-pOVxH!g4v9vOF@f;VPR^25y+;#o?0!t zy9GowP%0~tXArD zJ%>C30K~`R&6^3Zs$^$l>(-v#>z{MYj0`xP$jnsP%mWSw7A(Nam(c6c>;35yj7HdO zqmMv)i}ZA~x8vf)-F8xaf6|uY;N|tmS-f12?^Y}bI{7cjs-VwhRufHVEp)j88gOnt?Q+; z6G=&!HVv0A58hzN*WI^|CKH`bZw;phIywk&&mIqP8;^MfyLWThvawG%@l0DA@v7td`57~KPU0pnLhFUET9irVnLcf7jR4^rlAtAhb zS5ZHOd3cSD+_#Sb0ZdEdyLZa^_C=DIm&fE}&Y8orXZiD|(i+axkR;^gAwM5QMFi(7x*B#n>~^%Z!QUTR sEkqF!5m>SWMkAIl$Mor=eH;MbKfR@yM{%PWhX4Qo07*qoM6N<$f~@54jsO4v literal 0 HcmV?d00001 diff --git a/collects/teachpack/2htdp/scribblings/img/_star-polygon_20_10_3__solid___cornflowerblue__.png b/collects/teachpack/2htdp/scribblings/img/_star-polygon_20_10_3__solid___cornflowerblue__.png new file mode 100644 index 0000000000000000000000000000000000000000..f7a36ef71638feffe1f4402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8nh|Y0E_PJ~ z?L|RAX;j$RdG!+hy_Y<#kMzCEi`m0_igq+Q(;qh1iI&WIX??VD?s>JN(Rp}JQF$@` zvpfs-ZgCxIE0mn6A2iolU{QdcMw2%+JC~g7p|--kTQXbrxL1VtU-r~56UvJ@s|MDj z22YkadM@nXnFBlBi=-Uv!@>*dz!DmPAgn6k7WO)W1vKn{{{W)8W!CsDsW1Ql002ov JPDHLkV1lAk-;MwP literal 0 HcmV?d00001 diff --git a/collects/teachpack/2htdp/scribblings/img/_star-polygon_40_5_2__solid___seagreen__.png b/collects/teachpack/2htdp/scribblings/img/_star-polygon_40_5_2__solid___seagreen__.png new file mode 100644 index 0000000000000000000000000000000000000000..ef08dc0821ddfc0a351383b0c599c893db61e77b GIT binary patch literal 1615 zcmV-V2C(^wP)-haJjpvk{*WV8tkFl-Un#jIFBa9zG+$i=mJ^ zjw>-g9=I?xM*Y*y7RRZ)wPCy4!5L(ojtRL6H#^NMR zQp2MoHLZ`?Vl>^|`p#M&F$jiX>NJh}{y3>Kb@AA)4_AVS3X55YbDH2;uVnqcUjrlpa^=TPMA5tP~&+7Nq2Sv>?qT?ur2b7VF5d z>YsnDyD?dPW2-q+XG+s|&VD6o;w3j2cHL~g|HZY_y@P$2`^Huq5?2>MH(^*rdBh*E~u8i{AmGw+ay!h^YT*wKyCXoKU+Y@ z@Scz2q`$j6R0fSdEg)i8`Th>(XPyBOqo%dNIN0xxv5Wl7`XFL>%9$hUiB6^KGay$- z!LTt*6^2x-Kj{(_jC*ZQy3HnJOHcCW>jw%(xst;jC8XVNbSA1!^9*^H#u`&|2D7iWwIn#QhyUZ2GT6umn&=erO0ii5(k7p^{^ zbtpz0>9ZE{rnQ>)s9GfM9js_#Tf}H-Yd$~^@AhBT)PAa80Eh1 zsEmY^i<^t%BVt_QfdWyHBwxB_XNV}sQ{CZF%k37Fe*tjAc%)T!dY;`wL_yLuJBuXw zfdY}IGLpGVF6ADbAL(&hhqexK!|<}|&5xXODfg&k?h>DkM21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wqj7c$WyZ<>eS!E~ zTowz!u)3DkkAi(ECWBBKZY^0N?d9_B(IXm}JT6(yXR~8mT?@{hmDuDZjdp*}9_+0I z001C-r7DpTnMv>BOP8YN%@ZW61h~IvPwLjK(ws$iSy{M)1NMe~2qiMo^7ygLq<5N+ z&;8xI1=r;iN`#{$hry604D)!`w6sv>4<`&Iekp)(VpWK>;o)5+B`>MewkJ;t&Ys!Lj%>&P;_S~jxvA$2mAM9W2Yo2g^`|@FK^h{AqcPs z2SaDfsEUXXuWHK32sAMfKfo+RS8;K~?AaJtDFsTIH8Q3Q45w||Hf`NHiJ!XIcz8H} z|9$f2%`lfMu{FubX|S=8%V1z-?Kmil5ew;zsrcfVzYP1rtCBz@CwckdS*{d?8*w+T9&wX<3($fL>K&TH19pGw~y> zjE)Wpk*JWB(t-V~k?2HVE;rTN+wsdUZMSSeuWFi?*PMO(QoOwZk0)BLZDOLXqcd1v zkAb;jPzodBPUO)KKWG{lEIEBzUTvupj6B%Cztqo9cstzELNhjQe(*qX&Gku1K^7LmodKWCzBXlw zg84>?z?hM+nKOka2e?dTl(Tcm<;z$pe|qv{?1~k_W9?S*4?_*n3ncBCI(X8j~-z--h@f-x0#uNCMF|oZ5S#SqPMDwVqnlyUOwE?LNhYL zTtAkK2$J3db#*dh91244aS^MxH_*gnVuySXfLSb_Gdw&{S7+eh5WRS@o3F2lt1DKT z#bN91-BnVO=Hp}P>e})AxvsS}hRQMXBkfP08ZTOO?~5<2Rd$& zA1j4uz-Vvx*VUExcR7%O%@|>{w?{ZSepyweV`iqfHq`>NS@U0m{{sRKzj+&rG8+H@ N002ovPDHLkV1kcTY@h%D literal 0 HcmV?d00001 diff --git a/collects/teachpack/2htdp/scribblings/img/_star_40__solid___gray__.png b/collects/teachpack/2htdp/scribblings/img/_star_40__solid___gray__.png index ccecddf5d7af15c775c3f3fe83f0da87e4f7c139..1e0951d5c7e879ea1ddbf3cface8ffbabee6b8bc 100644 GIT binary patch delta 1245 zcmV<31S0$G3-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htdp/test-image.ss b/collects/tests/2htdp/test-image.ss index 292f045db1..b651402514 100644 --- a/collects/tests/2htdp/test-image.ss +++ b/collects/tests/2htdp/test-image.ss @@ -68,6 +68,17 @@ (map loop (cdr (vector->list (struct->vector x))))))] [else x]))) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; +;; circle vs ellipse +;; + +(check-equal? (ellipse 40 40 'outline 'black) + (circle 20 'outline 'black)) +(check-equal? (ellipse 60 60 'solid 'red) + (circle 30 'solid 'red)) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; width and height @@ -536,8 +547,9 @@ ;; regular polygon ;; +;; note: the regular-polygon and the rectangle generate the points in reverse directions. (check-equal? (round-numbers (regular-polygon 100 4 'outline 'green)) (round-numbers (rectangle 100 100 'outline 'green))) -(check-equal? (swizzle (list 0 1 2 3 4)) +(check-equal? (swizzle (list 0 1 2 3 4) 2) (list 0 2 4 1 3))