% input HIgraph %---------------------------------------------------------- % HIArrowArc and HIArrowCircle % 2005/06/06 17:30 %============================================================================= % HIArrowArc : arrow between two point % % arrow between two point a and b % a : point with unity. start point % b : point with unity. end point % marge: size with unity. space around the points a and b % h : percent. it changes the rayon of the arc: it defines "sommet" point % h=0 : means line % h=1 : means diameter = (a,b) % h=-1 : means diameter = (a,b), but contre-clock direction % h small: rayon bigger % flen: fleche len, need change carrefuly, % - if too small: will not appear arrow % - if too big: will see line arrow % f : percent. it changes the arrow position % f=0.01 : arrow near the start point a (need a little big than 0) % f=1 : arrow near the end point b % f=1/2 : arrow in middle of the arc % vardef HIArrowArc(expr a, b, marge, h, flen, f)= save cir, pcenter, psommet, psommeth,arc, fper; path cir, arc; pair psommet, pcenter, psommeth; numeric fper; pcenter:=1/2[a,b]; psommet := pcenter + (ypart(a)-ypart(pcenter), xpart(pcenter)-xpart(a)); psommeth:= h[pcenter, psommet]; arc=a..psommeth..b; cir:=fullcircle scaled marge; arc:= arc cutbefore (cir shifted a) cutafter (cir shifted b); fper:=f*length(arc); drawarrow (point (fper-flen) of arc) -- (point fper of arc); draw arc; dotlabel("", a); dotlabel("", b); enddef; % pta : le cercle passe par ce point (le point noir) % c : le centre du cercle, relative a pta % dist: distance minimum entre le cercle et pta % marge: la taille du blanc efface sur le cercle % flen: fleche len, need change carrefuly, % - if too small: will not appear arrow % - if too big: will see line arrow % f : percent. it changes the arrow position % f=0.01 : arrow near the start point a (need a little big than 0) % f=1 : arrow near the end point b % f=1/2 : arrow in middle of the arc vardef HIArrowCircle(expr pta, c, dist, marge, flen, f)= save ta, tb, tc, td, cir,p, fper; pair ta, tb, tc, td,p; path cir, cp; numeric fper; p:=pta+dist/((xpart c) ++ (ypart c))*c; cir:=fullcircle scaled marge shifted p; ta:=p; tb:=p+c+ (c rotated 90); tc:=p+c+c; td:=p+c+ (c rotated -90); cp:= ta..tb..tc..td..(ta) cutbefore cir cutafter cir; fper:=f*length(cp); drawarrow (point (fper-flen) of cp) -- (point fper of cp); draw cp; dotlabel("", pta); enddef; % END %============================================================================= vardef Index(expr a, arete, sommet)= label.rt(arete, a); label.rt(sommet, a+(4.5u,0)); draw a+(7u,0)..a+(8.6u,0); enddef; vardef IndexName(expr a, arete, sommet, name)= label.rt(arete, a); label.rt(sommet, a+(4.5u,0)); label.rt(name, a+(7u,0)-(0.16u,0)); enddef; %---------------------------------------------------------- beginfig(1); u=1.22cm; z1 = (1.5u, 7u); z2 = (5u, 10u); z3 = (8u, 8u); z4 = (8u, 5u); z5 = (5.5u, 3u); z6 = (2.5u, 4u); pair a, dy; a := (0.2u, 1u); dy:= (0u, 0.4u); IndexName(a, btex Ar\^etes etex, btex Sommets etex, btex Code etex); a:=a-1.5dy; % c1= f61 f41 / 646 / + + + + + drawoptions(withpen pencircle scaled 0.8pt dashed evenly scaled 2); marge:=0.0u; HIArrowArc(z4,z6, marge, -0.2, 0.1, 0.5); HIArrowArc(z6,z4, marge, -0.2, 0.1, 0.5); %draw a..a+(1.6u,0); %label(btex c1 etex, a-(0.3u,0)); Index(a, btex \$c_1=f_{6,1}f_{4,1}\$ etex, btex \$ 6\, 4\, 6\$ etex); a:=a-dy; % c2 = f62 / 66 / ^v^v^v^v^v^v^ drawoptions(withpen pencircle scaled 0.8pt dashed evenly scaled 3); HIArrowCircle(z6, (-0.5u, -0.2u), 0u, marge, 0.2, 0.5); Index(a, btex \$ c_2=f_{6,2}\$ etex, btex \$ 6\,6\$ etex); a:=a-dy; % c3 = 6 5 4 4 3 1 2 6 / --------------- drawoptions(withpen pencircle scaled 0.4pt); HIArrowArc(z6,z5, marge, -0.25, 0.1, 0.5); HIArrowArc(z5,z4, marge, -0.25, 0.1, 0.5); HIArrowCircle(z4, (0.5u, -0.2u), 0u, marge, 0.2, 0.5); HIArrowArc(z4,z3, marge, -0.25, 0.15, 0.5); HIArrowArc(z3,z1, marge, 0.4, 0.15, 0.70); HIArrowArc(z1,z2, marge, -0.55, 0.15, 0.4); HIArrowArc(z2,z6, marge, 0.3, 0.10, 0.5); Index(a, btex \$ c_3=f_{6,3}f_{5,1}f_{4,2}f_{4,3}f_{3,1}f_{1,1}f_{2,1}\$ etex, btex \$ 6\,5\,4\,4\,3\,1\,2\,6\$ etex); a:=a-dy; % c4 = 422134 / _ . _ . _ . drawoptions(withpen pencircle scaled 0.4pt dashed dashpattern(on 10bp off 2bp on 1bp off 2bp)); HIArrowArc(z4,z2, marge, 0.1, 0.15, 0.5); HIArrowCircle(z2, (0.1u, 0.6u), 0u, marge, 0.2, 0.5); HIArrowArc(z2,z1, marge, -0.7, 0.15, 0.4); HIArrowArc(z1,z3, marge, -0.6, 0.15, 0.5); HIArrowArc(z3,z4, marge, -0.25, 0.15, 0.5); Index(a, btex \$c_4=f_{4,4}f_{2,2}f_{2,3}f_{1,2}f_{3,2}\$ etex, btex \$ 4\,2\,2\,1\,3\,4\$ etex); a:=a-dy; % c5 = 33 / - - - - drawoptions(withpen pencircle scaled 0.4pt dashed evenly); HIArrowCircle(z3, (0.4u, 0.4u), 0u, marge, 0.2, 0.5); Index(a, btex \$c_5=f_{3,3}\$ etex, btex \$3\,3\$ etex); a:=a-dy; % c6 = 32123 / TTTTT drawoptions(withpen pencircle scaled 0.8pt dashed dashpattern(on 5bp off 2bp on 5bp off 2bp on 1bp off 2bp)); HIArrowArc(z3,z2, marge, -0.25, 0.15, 0.5); HIArrowArc(z2,z1, marge, -0.4, 0.15, 0.6); HIArrowArc(z1,z2, marge, -0.35, 0.15, 0.6); HIArrowArc(z2,z3, marge, -0.25, 0.15, 0.5); Index(a, btex \$c_6=f_{3,4}f_{2,4}f_{1,3}f_{2,5}\$ etex, btex \$ 3\,2\,1\,2\,3\$ etex); a:=a-dy; % c7 = 2112 / -*-*-*-*- drawoptions(withpen pencircle scaled 0.8pt); HIArrowArc(z2,z1, marge, -0.1, 0.15, 0.4); HIArrowCircle(z1, (-0.5u, -0.1u), 0u, marge, 0.2, 0.5); HIArrowArc(z1,z2, marge, -0.1, 0.15, 0.4); Index(a, btex \$c_7=f_{2,6}f_{1,4}f_{1,5}\$ etex, btex \$ 2\,1\,1\,2\$ etex); a:=a-dy; % _______________________________________ drawoptions(withpen pencircle scaled 4mm ); draw z1; draw z2; draw z3; draw z4; draw z5; draw z6; drawoptions(withcolor white); label(btex 1 etex, z1); label(btex 2 etex, z2); label(btex 3 etex, z3); label(btex 4 etex, z4); label(btex 5 etex, z5); label(btex 6 etex, z6); %_________________________________________ drawoptions(withcolor black); s=1/10u; % c1 label(btex \$f_{6,1}\$ etex, 1/2[z6,z4]+(2s,-8s)); label(btex \$f_{4,1}\$ etex, 1/2[z6,z4]+(0.5s,3s)); % c2 label(btex \$f_{6,2}\$ etex, z6+(-6.5s, -3.5s)); % c3 label(btex \$f_{6,3}\$ etex, 1/2[z5,z6]+(-1.5s, -6s)); label(btex \$f_{5,1}\$ etex, 1/2[z5,z4]+(4s, -5.5s)); label(btex \$f_{4,2}\$ etex, z4+(7s, -3s)); label(btex \$f_{4,3}\$ etex, 1/2[z4,z3]+(6.5s, -0.5s)); label(btex \$f_{3,1}\$ etex, 1/2[z3,z1]+(-12s, -10.5s)); label(btex \$f_{1,1}\$ etex, 1/2[z2,z1]+(5.5s, -14.5s)); label(btex \$f_{2,1}\$ etex, 1/2[z2,z6]+(12s, -4s)); % c4 label(btex \$f_{4,4}\$ etex, 1/2[z4,z2]+(s, -s)); label(btex \$f_{2,2}\$ etex, 1/2[z2,z2]+(2s, 9s)); label(btex \$f_{2,3}\$ etex, 1/2[z2,z1]+(-8s, 17s)); label(btex \$f_{1,2}\$ etex, 1/2[z3,z1]+(3s, -17s)); label(btex \$f_{3,2}\$ etex, 1/2[z3,z4]+(-1s, 0s)); % c5 label(btex \$f_{3,3}\$ etex, 1/2[z3,z3]+(6s, 6s)); % c6 label(btex \$f_{3,4}\$ etex, 1/2[z3,z2]+(5.5s, 5.5s)); label(btex \$f_{2,4}\$ etex, 1/2[z1,z2]+(-11s, 6s)); label(btex \$f_{1,3}\$ etex, 1/2[z1,z2]+(10s, -5s)); label(btex \$f_{2,5}\$ etex, 1/2[z3,z2]+(0s, -1.5s)); % c7 label(btex \$f_{2,6}\$ etex, 1/2[z1,z2]+(0s, 7s)); label(btex \$f_{1,4}\$ etex, 1/2[z1,z1]+(-7s, -1.5s)); label(btex \$f_{1,5}\$ etex, 1/2[z1,z2]+(-1.5s, -7.5s)); %HIgrille(1/2[z1,z2], s, 17); endfig; end