29.11.2012 Views

MetaFun - Pragma ADE

MetaFun - Pragma ADE

MetaFun - Pragma ADE

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

pointC := circleA intersectionpoint circleB ;<br />

pointD := (reverse circleA) intersectionpoint (reverse circleB) ;<br />

draw_dot pointC ; label.lft(btex C etex, pointC shifted (-2w,0)) ;<br />

draw_dot pointD ; label.lft(btex D etex, pointD shifted (-2w,0)) ;<br />

enddef ;<br />

\stopbuffer<br />

In placing the label, we must make sure that the text runs free of the lines and curves. Again, move<br />

the stand_out macro just prior to draw_intersection macro, so that this step is highlighted in<br />

the drawing color, while prior steps are drawn in the default color (in this case black).<br />

\startbuffer[3]<br />

start_everything ;<br />

draw_basics ; draw_circles ; stand_out ; draw_intersection ;<br />

stop_everything ;<br />

\stopbuffer<br />

C<br />

A B<br />

D<br />

The line drawn through points C and D will be the perpendicular bisector of the line segment connecting<br />

points A and B. In the next step we will draw a line using the plain METAPOST drawdblarrow<br />

macro that draws arrowheads at each end of a path.<br />

\startbuffer[f]<br />

def draw_bisector =<br />

path lineCD ;<br />

lineCD := origin -- origin shifted (2*distance,0) ;<br />

lineCD := lineCD rotated 90 shifted 0.5[pointA,pointB] ;<br />

lineCD := lineCD shifted (0,-distance) ;<br />

drawdblarrow lineCD ;<br />

enddef ;<br />

\stopbuffer<br />

\startbuffer[4]<br />

start_everything ;<br />

draw_basics ; draw_circles ; draw_intersection ; stand_out ;<br />

draw_bisector ;<br />

stop_everything ;<br />

\stopbuffer<br />

Growing graphics A few applications<br />

299

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

Saved successfully!

Ooh no, something went wrong!