29.11.2012 Views

MetaFun - Pragma ADE

MetaFun - Pragma ADE

MetaFun - Pragma ADE

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

314<br />

Of course it would be best to define the euro as one shape, but we won't go though that process<br />

right now. By packaging the combined paths in an image, we can conveniently color the euro<br />

symbol:<br />

draw euro_symbol withcolor .625red ;<br />

You may wonder why we both draw and fill the euro, using a pen with zero width. We've done<br />

this in order to demonstrate the redraw and refill macros.<br />

redraw currentpicture withpen pencircle scaled 4pt withcolor .625yellow ;<br />

refill currentpicture withcolor .625white ;<br />

setbounds currentpicture to boundingbox currentpicture enlarged 2pt ;<br />

13.10 Killing time<br />

Not seldom TEX users want to use this program and its meta--relatives as general purpose tools,<br />

even at the cost of quite some effort or suboptimal results. Imagine that you are under way from<br />

our planet to Mars. After a long period of sleep you wake up and start wondering on what track<br />

you are. You even start questioning the experts that send you on your way, so you pop open your<br />

laptop, launch your editor and start metaposting.<br />

First you need to determine the begin and end points of your journey. For this it is enough to know<br />

the relative angle of the paths that both planets follow as well as the path themselves. We assume<br />

circular paths.<br />

path a ; a := fullcircle scaled 3cm ;<br />

path b ; b := fullcircle scaled 2cm rotated 120 ;<br />

draw a withpen pencircle scaled 1mm withcolor .625red ;<br />

A few applications Killing time

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!