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.

22<br />

1<br />

"(z0..z1..z2..z3) cutbefore point 2.5 of (z0..z1..z2..z3)"<br />

0<br />

If you really want to know the details of where fraction points are positioned, you should read the<br />

METAFONT book and study the source of METAFONT and METAPOST, where you will find the complicated<br />

formulas that are used to calculate smooth curves.<br />

2<br />

0<br />

1<br />

"z0..z1..cycle"<br />

Like any closed path, this path has points where the tangent is horizontal or vertical. Early in this<br />

chapter we mentioned that a pair (or point) can specify a direction or vector. Although any angle<br />

is possible, we often use one of four predefined directions:<br />

right ( 1, 0)<br />

up ( 0, 1)<br />

left (-1, 0)<br />

down ( 0,-1)<br />

We can use these predefined directions in combination with directionpoint and cutafter. The<br />

following command locates the first point on the path that has a tangent that points vertically<br />

upward, and then feeds this point to the cutafter command.<br />

0<br />

"(z0..z1..cycle) cutafter directionpoint up of (z0..z1..cycle)"<br />

1<br />

You are not limited to predefined direction vectors. You can provide a pair denoting a direction.<br />

In the next example we use the following cyclic path:<br />

Welcome to MetaPost Constructing paths

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

Saved successfully!

Ooh no, something went wrong!