summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/featpost/example/pifpaf.mp
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-04-16 22:46:29 +0000
committerKarl Berry <karl@freefriends.org>2012-04-16 22:46:29 +0000
commit76e16dc8afcc19ccbb1cc66be529411dfe41ce6e (patch)
tree5e79f4db9f36c7e53887264b98bf3b33d41daa5f /Master/texmf-dist/doc/metapost/featpost/example/pifpaf.mp
parent9d51929278483d4f1cbfe10dee38085f3ca4811c (diff)
featpost (16apr12)
git-svn-id: svn://tug.org/texlive/trunk@25991 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/metapost/featpost/example/pifpaf.mp')
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/pifpaf.mp56
1 files changed, 56 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/pifpaf.mp b/Master/texmf-dist/doc/metapost/featpost/example/pifpaf.mp
new file mode 100644
index 00000000000..f17d2852d02
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/pifpaf.mp
@@ -0,0 +1,56 @@
+% pifpaf.mp
+% L. Nobre G.
+% 2010
+
+prologues := 1;
+
+beginfig(1);
+ numeric u, siz, lena, lenb, lenc, anga, angb, angc, astep;
+ u = 7mm;
+ siz = 12u;
+ lena = 9u;
+ lenb = 8u;
+ lenc = 4u;
+ astep = 1.7;
+ z1 = (-lenb,siz-lena);
+ z2 = (lenb,siz-lena);
+ path circa, circb;
+ numeric auxa, auxb, auxc, lend;
+ auxa = 2*(lena+2*lenc);
+ auxb = 2*lena;
+ circa = fullcircle scaled auxa shifted z1;
+ circb = fullcircle scaled auxb shifted z2;
+ z3 = circa intersectionpoint circb;
+ anga = angle(z3-z1);
+ angb = 180-angle(z3-z2);
+ auxc = lena +-+ (lenb-lenc);
+ angc = angle(lenb-lenc,auxc);
+ show (anga,angc,angb);
+ z4 = z2+(lenc-lenb,auxc);
+ z5 = z1+(lenb-lenc,auxc);
+ draw z1--z2--z4--z5--cycle;
+ draw z1--z2--z3--cycle;
+ z6 = z1+lena*dir(anga);
+ z7 = z2+lena*dir(180-angb);
+ z8 = 0.5[z6,z7];
+ lend = siz-lena+auxc;
+ z9 = z8+lend*dir(anga-90);
+ draw z8--z9;
+ draw origin withpen pencircle scaled 3pt;
+ numeric i, diamc;
+ pair parp, intp, pa, pb;
+ diamc = 4*lenc;
+ for i=anga step astep until angc:
+ parp := z1+lena*dir(i);
+ circa := fullcircle scaled diamc shifted parp;
+ intp := circa intersectionpoint circb;
+ pa := 0.5[parp,intp];
+ pb := lend*unitvector((ypart (intp-parp),-xpart (intp-parp)));
+ draw pa--(pa+pb);
+ draw (-xpart (pa+pb),ypart (pa+pb)) withpen pencircle scaled 2pt;
+ draw (pa+pb) withpen pencircle scaled 2pt;
+ endfor;
+
+endfig;
+
+end. \ No newline at end of file