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.

(x,y) zscaled (u,v) (xu − yv,xv + yu)<br />

(x,y) slanted s (x + sy,y)<br />

(x,y) rotated r (x cos(r) − y sin(r), x sin(r) + y cos(r))<br />

The previously mentioned rotatedaround is not a primitive but a macro, defined in terms of<br />

shifts and rotations. Another transformation macro is mirroring, or in METAPOST terminology,<br />

reflectedabout.<br />

The reflection axis is specified by a pair of points. For example, in the graphic above, we used the<br />

following command to reflect the square about a line through the given points.<br />

p reflectedabout((2.4cm,-.5),(2.4cm,3cm))<br />

The line about which the path is mirrored. Mirroring does not have to be parallel to an axis.<br />

p reflectedabout((2.4cm,-.5),(2.6cm,3cm))<br />

The rectangle now becomes:<br />

The table also mentions zscaled.<br />

Transformations Welcome to MetaPost<br />

13

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

Saved successfully!

Ooh no, something went wrong!