PasteRack.org
Paste #
7728
2014-03-27 13:42:24
Fork
as a new paste.
Paste viewed 538 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"><a class="RktValLink" data-pltdoc="x" href="http://docs.racket-lang.org/pict/Pict_Datatype.html#%28def._%28%28lib._pict%2Fmain..rkt%29._pict%29%29">pict</a></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/7728.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/7728_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/7728_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/7728_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/7728_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/7728_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/7728_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/7728_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/7728_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/7728_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/7728_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/7728_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/7728_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/7728_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/7728_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/7728_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/7728_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/7728_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/7728_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/7728_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/7728_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/7728_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/7728_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/7728_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/7728_25.png" style="" width="101"/><span class="RktRes">)</span></p></td></tr></table></blockquote></div>
rotating a length-scaled arrow
#lang
racket
(
require
pict
)
(
for/list
[
(
i
25
)
]
(
frame
(
rotate
(
scale
(
arrow
50
0
)
2
1
)
(
*
pi
(
/
i
12
)
)
)
#:segment
5
#:color
"blue"
#:line-width
1
)
)
=>
'(
)