PasteRack.org
Paste #
5791
2014-03-27 13:45:23
Forked from paste #
8308
.
Fork
as a new paste.
Paste viewed 4132 times.
Tweet
Embed:
<link type="text/css" rel="stylesheet" href="http://pasterack.org/scribble.css"/><link type="text/css" rel="stylesheet" href="http://pasterack.org/racket.css"/><link type="text/css" rel="stylesheet" href="http://fonts.googleapis.com/css?family=Droid+Sans+Mono"/><div style="font-family:'Droid Sans Mono',monospace;background-color:transparent"><ol start="0" style="font-size:70%;color:#A0A0A0"><li><span style="font-family:'Droid Sans Mono',monospace;font-size:125%"><span class="RktMeta">#lang</span><span class="hspace"> </span><span class="RktMeta"></span><a class="RktModLink" data-pltdoc="x" href="http://docs.racket-lang.org/reference/index.html"><span class="RktSym">racket</span></a><span class="RktMeta"></span></span></li><li><span style="font-family:'Droid Sans Mono',monospace;font-size:125%"><span class="RktMeta"> </span></span></li><li><span style="font-family:'Droid Sans Mono',monospace;font-size:125%"><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a class="RktStxLink" data-pltdoc="x" href="http://docs.racket-lang.org/reference/require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._require%29%29">require</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym">slideshow/pict</span><span class="RktPn">)</span><span class="RktMeta"></span></span></li><li><span style="font-family:'Droid Sans Mono',monospace;font-size:125%"><span class="RktMeta"> </span></span></li><li><span style="font-family:'Droid Sans Mono',monospace;font-size:125%"><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a class="RktStxLink" data-pltdoc="x" href="http://docs.racket-lang.org/reference/for.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._for%2Flist%29%29">for/list</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">[</span><span class="RktPn">(</span><span class="RktSym">i</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">25</span><span class="RktPn">)</span><span class="RktPn">]</span><span class="RktMeta"></span></span></li><li><span style="font-family:'Droid Sans Mono',monospace;font-size:125%"><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a class="RktValLink" data-pltdoc="x" href="http://docs.racket-lang.org/pict/Basic_Pict_Constructors.html#%28def._%28%28lib._pict%2Fmain..rkt%29._frame%29%29">frame</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a class="RktValLink" data-pltdoc="x" href="http://docs.racket-lang.org/pict/Pict_Drawing_Adjusters.html#%28def._%28%28lib._pict%2Fmain..rkt%29._rotate%29%29">rotate</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a class="RktValLink" data-pltdoc="x" href="http://docs.racket-lang.org/pict/Pict_Drawing_Adjusters.html#%28def._%28%28lib._pict%2Fmain..rkt%29._scale%29%29">scale</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a class="RktValLink" data-pltdoc="x" href="http://docs.racket-lang.org/pict/Basic_Pict_Constructors.html#%28def._%28%28lib._pict%2Fmain..rkt%29._arrow%29%29">arrow</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">50</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">0</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">2</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a class="RktValLink" data-pltdoc="x" href="http://docs.racket-lang.org/reference/generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._%2A%29%29">*</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym"><a class="RktValLink" data-pltdoc="x" href="http://docs.racket-lang.org/reference/generic-numbers.html#%28def._%28%28lib._racket%2Fmath..rkt%29._pi%29%29">pi</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">(</span><span class="RktSym"><a class="RktValLink" data-pltdoc="x" href="http://docs.racket-lang.org/reference/generic-numbers.html#%28def._%28%28quote._~23~25kernel%29._%2F%29%29">/</a></span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktSym">i</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">12</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></span></li><li><span style="font-family:'Droid Sans Mono',monospace;font-size:125%"><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">#:segment</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">5</span><span class="RktMeta"></span></span></li><li><span style="font-family:'Droid Sans Mono',monospace;font-size:125%"><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">#:color</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">"blue"</span><span class="RktMeta"></span></span></li><li><span style="font-family:'Droid Sans Mono',monospace;font-size:125%"><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktPn">#:line-width</span><span class="RktMeta"></span><span class="hspace"> </span><span class="RktMeta"></span><span class="RktVal">1</span><span class="RktPn">)</span><span class="RktPn">)</span><span class="RktMeta"></span></span></li></ol><p>=></p><blockquote><table style="font-size:90%;table-layout:fixed;width:100%;word-wrap:break-word"><tr><td><p><span class="RktRes">'(</span><img alt="image" height="50" src="http://pasterack.org/5791.png" style="" width="100"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="75" src="http://pasterack.org/5791_2.png" style="" width="110"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="94" src="http://pasterack.org/5791_3.png" style="" width="112"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="107" src="http://pasterack.org/5791_4.png" style="" width="107"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="112" src="http://pasterack.org/5791_5.png" style="" width="94"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="110" src="http://pasterack.org/5791_6.png" style="" width="75"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="100" src="http://pasterack.org/5791_7.png" style="" width="51"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="110" src="http://pasterack.org/5791_8.png" style="" width="75"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="112" src="http://pasterack.org/5791_9.png" style="" width="94"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="107" src="http://pasterack.org/5791_10.png" style="" width="107"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="94" src="http://pasterack.org/5791_11.png" style="" width="112"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="75" src="http://pasterack.org/5791_12.png" style="" width="110"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="51" src="http://pasterack.org/5791_13.png" style="" width="100"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="75" src="http://pasterack.org/5791_14.png" style="" width="110"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="94" src="http://pasterack.org/5791_15.png" style="" width="112"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="107" src="http://pasterack.org/5791_16.png" style="" width="107"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="112" src="http://pasterack.org/5791_17.png" style="" width="94"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="110" src="http://pasterack.org/5791_18.png" style="" width="75"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="101" src="http://pasterack.org/5791_19.png" style="" width="51"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="110" src="http://pasterack.org/5791_20.png" style="" width="75"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="112" src="http://pasterack.org/5791_21.png" style="" width="94"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="107" src="http://pasterack.org/5791_22.png" style="" width="107"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="94" src="http://pasterack.org/5791_23.png" style="" width="112"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="75" src="http://pasterack.org/5791_24.png" style="" width="110"/><span class="RktRes"></span><span class="hspace"> </span><span class="RktRes"></span><img alt="image" height="51" src="http://pasterack.org/5791_25.png" style="" width="101"/><span class="RktRes">)</span></p></td></tr></table></blockquote></div>
rotating a length-scaled arrow
#lang
racket
(
require
slideshow/pict
)
(
for/list
[
(
i
25
)
]
(
frame
(
rotate
(
scale
(
arrow
50
0
)
2
1
)
(
*
pi
(
/
i
12
)
)
)
#:segment
5
#:color
"blue"
#:line-width
1
)
)
=>
'(
)