ch5.mp 16.6 KB
Newer Older
 Jim Hefferon committed Dec 05, 2011 1 2 3 4 5 6 7 8 % CH5.mp % MetaPost input file with chapter five pictures. % % HISTORY % 2001-Apr-15 Jim Hefferon jim@joshua.smcvt.edu Written verbatimtex %&latex \documentclass{book}  Jim Hefferon committed Mar 11, 2012 9 \usepackage{bookjh}  Jim Hefferon committed Mar 09, 2012 10 \usepackage{linalgjh}  Jim Hefferon committed Dec 05, 2011 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 \begin{document} etex input jh input arrow defaultscale := 9pt/fontsize defaultfont; numeric u; %scaling factor numeric v; %vertical scaling factor numeric w; %horizontal scaling factor u:=.04in; v:=u; w:=v; %-------------------------------- % section 5.3 % Map from a space to itself, iterated. % beginfig(1); % map from a space to itself %numeric u; %scaling factor %numeric v; %vertical scaling factor %numeric w; %horizontal scaling factor numeric a, b; a=.8in; b=1.1a; % a is width of set, b is hgt set_pic(a,b); z1=(.4a,.9b); drawpoint(z1); label.lft(btex $\vec{v}$ etex,z1); z2=(.5a,.55b); drawpoint(z2); label.lft(btex $t(\vec{v}\,)$ etex,z2); z3=(.6a,.15b); drawpoint(z3); label.lft(btex $t^2(\vec{v}\,)$ etex,z3); %mapsto(z1,.5[z1,z2]+(.1a,0),z2); %mapsto(z2,.5[z2,z3]+(.1a,0),z3); draw_action_arrow(z1..(.5[z1,z2]+(.1a,0))..z2); draw_action_arrow(z2..(.5[z2,z3]+(.1a,0))..z3); endfig; %-------------------------------- % section 5.3 % Graph of rank and nullity, on iteration of a transformation. % beginfig(2); %numeric u; %scaling factor %numeric v; %vertical scaling factor %numeric w; %horizontal scaling factor numeric a, b; % a is width, b is height a=2.5in; b=1.25in; draw begingraph(a,b); setrange(origin,whatever,whatever); gdraw "ranknullity.d" plot drawn_point; % btex$\circ$etex; % glabel.lft(btex \begin{tabular}{r} % nullity of $t^j$ (above) \\ % and \\ % rank of $t^j$ (below) % \end{tabular} etex,OUT);  Jim Hefferon committed Jan 19, 2012 67  glabel.bot(btex \small Power $j$ of the transformation etex,OUT);  Jim Hefferon committed Nov 09, 2013 68 69 70 71  otick.bot(btex \small $0$etex,1); otick.bot(btex \small $1$etex,2); otick.bot(btex \small $2$etex,3); otick.bot(btex \small $j$etex,5);  Jim Hefferon committed Dec 05, 2011 72 73 74  otick.bot(btex{\ }etex,8); grid.bot(btex$n$etex,9) withcolor .85white; otick.bot(btex{\ }etex,10);  Jim Hefferon committed Jan 19, 2012 75  grid.lft(btex \small $n$etex,8) withcolor .85white;  Jim Hefferon committed Dec 05, 2011 76 77  otick.lft(btex{\ }etex,7); otick.lft(btex{\ }etex,6);  Jim Hefferon committed Jan 19, 2012 78  otick.lft(btex$\small \text{rank}(t^j)$etex,3);  Jim Hefferon committed Dec 05, 2011 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116  otick.lft(btex{\ }etex,1); otick.lft(btex{\ }etex,1); otick.lft(btex{\ }etex,1); frame.llft; endgraph; endfig; %-------------------------------- % section 5.3 % Graph of rank and nullity, on iteration of a transformation. % beginfig(3); %graph of rank and nullity on iteration %numeric u; %scaling factor %numeric v; %vertical scaling factor %numeric w; %horizontal scaling factor numeric a, b; % a is width, b is height a=2.5in; b=1.25in; pickup pensquare scaled line_width_light; draw (0,b)--(0,0)--(a,0); label.lft(btex \begin{tabular}{r} nullity of $t^j$ (above) \\ and \\ rank of $t^j$ (below) \end{tabular} etex,.5[(0,b),(0,0)]); label.bot(btex Power $j$ of the transformation etex,.5[(0,0),(a,0)]); endfig; beginfig(4) % equiv relation; row-equiv mats from ch1.27, further split numeric u; %scaling factor numeric v; %vertical scaling factor numeric w; %horizontal scaling factor u:=1in; v:=u; w:=v; % was: 1in path p[]; partition; % dotlabels.ulft(5,6,7,8,9,10,11,12,13);  Jim Hefferon committed Nov 09, 2013 117  label(btex {\small \ldots} etex,z13);  Jim Hefferon committed Dec 05, 2011 118  x14=.8[x0,x9]; y14=.7[y10,y9]; drawpoint(z14);  Jim Hefferon committed Nov 09, 2013 119  label.rt(btex {\small $S$} etex,z14);  Jim Hefferon committed Apr 18, 2014 120  x15=.85[x0,x9]; y15=.3[y10,y9]; drawpoint(z15);  Jim Hefferon committed Nov 09, 2013 121  label.rt(btex {\small $T$} etex,z15);  Jim Hefferon committed Dec 05, 2011 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161  pickup pencircle scaled line_width_light; % split part in center z20=.5[z6,z8]; x21=.8[x20,x14]; y21=y20; z22=(z20--(3[z20,z21])) intersectionpoint p3; p20 = z20--z22; draw p20 dashed evenly scaled .5; z23 = point .6 of p1; z24 = whatever[z20,z22]; x24 = x23; p21 = z23--z24; draw p21 dashed evenly scaled .5; % split part in upper left z30 = point .25 of p1; z31 = whatever[z0,z3]; y31 = y30; p30 = z30--z31; draw p30 dashed evenly scaled .5; % split part in upper right z40 = point .55 of p4; z41 = point .85 of p4; z42 = whatever[z2,z3]; x42 = x40; p40 = z40--z42; z43 = whatever[z2,z3]; x43 = x41; p41 = z41--z43; draw p40 dashed evenly scaled .5; draw p41 dashed evenly scaled .5; endfig; beginfig(5) % equiv relation; finer partition needs more reps numeric u; %scaling factor numeric v; %vertical scaling factor numeric w; %horizontal scaling factor u:=1in; v:=u; w:=v; % was: 1in path p[]; partition; % dotlabels.ulft(5,6,7,8,9,10,11,12,13);  Jim Hefferon committed Nov 09, 2013 162  label(btex {\small \ldots} etex,z13);  Jim Hefferon committed Dec 05, 2011 163  x14=.8[x0,x9]; y14=.7[y10,y9]; %drawpoint(z14);  Jim Hefferon committed Nov 09, 2013 164  label.rt(btex {\small $\star$} etex,z14);  Jim Hefferon committed Dec 05, 2011 165  x15=.75[x0,x9]; y15=.35[y10,y9]; %drawpoint(z15);  Jim Hefferon committed Nov 09, 2013 166  label.rt(btex {\small $\star$} etex,z15);  Jim Hefferon committed Dec 05, 2011 167 168 169 170 171 172 173 174 175 176 177 178  pickup pencircle scaled line_width_light; % split part in center z20=.5[z6,z8]; x21=.8[x20,x14]; y21=y20; z22=(z20--(3[z20,z21])) intersectionpoint p3; p20 = z20--z22; draw p20 dashed evenly scaled .5; z23 = point .6 of p1; z24 = whatever[z20,z22]; x24 = x23; p21 = z23--z24; draw p21 dashed evenly scaled .5; z25=.55[z20,z24]; z26=.4[z24,z23];  Jim Hefferon committed Nov 09, 2013 179  label(btex {\small $\star$} etex,(x25,y26));  Jim Hefferon committed Dec 05, 2011 180 181 182 183 184 185  % split part in upper left z30 = point .25 of p1; z31 = whatever[z0,z3]; y31 = y30; p30 = z30--z31; draw p30 dashed evenly scaled .5; z32=.35[z31,z30]; z33=.5[z6,z31];  Jim Hefferon committed Nov 09, 2013 186  label(btex {\small $\star$} etex,(x32,y33));  Jim Hefferon committed Dec 05, 2011 187  z34=.55[z31,z30]; z35=.5[z3,z31];  Jim Hefferon committed Nov 09, 2013 188  label(btex {\small $\star$} etex,(x34,y35));  Jim Hefferon committed Dec 05, 2011 189 190 191 192 193 194 195 196 197 198 199  % split part in upper right z40 = point .55 of p4; z41 = point .85 of p4; z42 = whatever[z2,z3]; x42 = x40; p40 = z40--z42; z43 = whatever[z2,z3]; x43 = x41; p41 = z41--z43; draw p40 dashed evenly scaled .5; draw p41 dashed evenly scaled .5; z44=.5[z5,z43]; z45=.45[z41,z43];  Jim Hefferon committed Nov 09, 2013 200  label(btex {\small $\star$} etex,(x44,y45));  Jim Hefferon committed Dec 05, 2011 201  z46=.5[z43,z42]; z47=.55[z41,z43];  Jim Hefferon committed Nov 09, 2013 202  label(btex {\small $\star$} etex,(x46,y47));  Jim Hefferon committed Dec 05, 2011 203  z48=.45[z42,z11]; z49=.65[z40,z42];  Jim Hefferon committed Nov 09, 2013 204  label(btex {\small $\star$} etex,(x48,y49));  Jim Hefferon committed Dec 05, 2011 205 206  % then lower left z50=.4[z0,z7]; z51=.4[z0,z8];  Jim Hefferon committed Nov 09, 2013 207  label(btex {\small $\star$} etex,(x50,y51));  Jim Hefferon committed Dec 05, 2011 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233  %dotlabels.top(20,21,22,23,24,30,31,40,41,42,43); endfig; % ==================== Linear Recurrences =============== beginfig(6) % Tower of Hanoi (three disks at start) numeric u; %scaling factor numeric v; %vertical scaling factor numeric w; %horizontal scaling factor u:=10pt; v:=u; w:=v; % save disk_length, disk_width, disk_hgt; numeric disk_length, disk_width, disk_hgt; disk_length = 8u; disk_width = .4disk_length; disk_hgt = .2u; save needle_shift; pair needle_shift; needle_shift = (1.2disk_length,0v); save needle_length, needle_width, needle_hgt; numeric needle_length, needle_width, needle_hgt; % how thick is body of bee?  Jim Hefferon committed Mar 10, 2012 234  needle_length = .4u; needle_width = .4needle_length; needle_hgt = 4u;  Jim Hefferon committed Dec 05, 2011 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264  % left needle drawdisk(disk_length,disk_width,disk_hgt); drawdisk(.9disk_length,.9disk_width,disk_hgt) shifted (0,1.5disk_hgt); drawdisk(.8disk_length,.8disk_width,disk_hgt) shifted (0,3disk_hgt); drawdisk(needle_length,needle_width,needle_hgt-3disk_hgt) shifted (0,needle_hgt); % middle needle drawdisk(needle_length,needle_width,needle_hgt) shifted (0,needle_hgt) shifted needle_shift; % right needle drawdisk(needle_length,needle_width,needle_hgt) shifted (0,needle_hgt) shifted 2needle_shift; endfig; beginfig(7) % Tower of Hanoi (three disks at start) numeric u; %scaling factor numeric v; %vertical scaling factor numeric w; %horizontal scaling factor u:=10pt; v:=u; w:=v; % save disk_length, disk_width, disk_hgt; numeric disk_length, disk_width, disk_hgt; disk_length = 8u; disk_width = .4disk_length; disk_hgt = .2u; save needle_shift; pair needle_shift; needle_shift = (1.2disk_length,0v); save needle_length, needle_width, needle_hgt; numeric needle_length, needle_width, needle_hgt; % how thick is body of bee?  Jim Hefferon committed Mar 10, 2012 265  needle_length = .4u; needle_width = .4needle_length; needle_hgt = 4u;  Jim Hefferon committed Dec 05, 2011 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282  % left needle drawdisk(disk_length,disk_width,disk_hgt); drawdisk(needle_length,needle_width,needle_hgt-disk_hgt) shifted (0,needle_hgt); % middle needle drawdisk(.9disk_length,.9disk_width,disk_hgt) shifted needle_shift; drawdisk(.8disk_length,.8disk_width,disk_hgt) shifted (0,1.5disk_hgt) shifted needle_shift; drawdisk(needle_length,needle_width,needle_hgt-2disk_hgt) shifted (0,needle_hgt) shifted needle_shift; % right needle drawdisk(needle_length,needle_width,needle_hgt) shifted (0,needle_hgt) shifted 2needle_shift; endfig;  Jim Hefferon committed Jan 19, 2012 283 284 285 286 287 288 289 290 291 292  beginfig(8) % graph of rank falling and nullity rising numeric u; %scaling factor numeric v; %vertical scaling factor numeric w; %horizontal scaling factor u:=10pt; v:=u; w:=v; % % axes z0=(0w,0v);  Jim Hefferon committed Jan 20, 2012 293 294  z1=(+.5w,0v); z2=(21.5w,0v); % x axis z3=(0w,+.5v); z4=(0w,9.5v); % y axis  Jim Hefferon committed Jan 19, 2012 295 296 297  pickup pensquare scaled line_width_light; draw z1--z2; draw z3--z4;  Jim Hefferon committed Jan 20, 2012 298 299  % label.lrt(btex \small power etex,z2); % label.ulft(btex \small rank etex,z4);  Jim Hefferon committed Jan 19, 2012 300  % point of interest  Jim Hefferon committed Jan 20, 2012 301  z10=(10w,3.75v);  Jim Hefferon committed Jan 19, 2012 302 303 304 305 306  % ticks pickup updown_tick; for i = 1 upto 3: drawdot (i*w,0v); endfor  Jim Hefferon committed Nov 09, 2013 307 308 309  label.bot(btex \small $0$ etex,(1w,0v)); label.bot(btex \small $1$ etex,(2w,0v)); label.bot(btex \small $2$ etex,(3w,0v));  Jim Hefferon committed Jan 19, 2012 310  drawdot (x10,0v);  Jim Hefferon committed Nov 09, 2013 311  label.bot(btex \small $j$ etex,(10w,0v));  Jim Hefferon committed Jan 20, 2012 312  for i = 17 upto 21:  Jim Hefferon committed Jan 19, 2012 313 314  drawdot (i*w,0v); endfor  Jim Hefferon committed Nov 09, 2013 315 316 317  % label.bot(btex \small $k$ etex,(18w,0v)); label.bot(btex \small $n$ etex,(20w,0v)); % label.bot(btex \small $k+1$ etex,(14w,0v));  Jim Hefferon committed Jan 19, 2012 318  pickup sidetoside_tick;  Jim Hefferon committed Jan 20, 2012 319  for i = 9 upto 9:  Jim Hefferon committed Jan 19, 2012 320 321  drawdot (0w,i*v); endfor  Jim Hefferon committed Nov 09, 2013 322  label.lft(btex \small $n$ etex,(0w,9v));  Jim Hefferon committed Jan 20, 2012 323 324  % drawdot (0w,y10); for i = 1 upto 1:  Jim Hefferon committed Jan 19, 2012 325 326  drawdot (0w,i*v); endfor  Jim Hefferon committed Nov 09, 2013 327  label.lft(btex \small $0$ etex,(0w,1v));  Jim Hefferon committed Jan 19, 2012 328  % The points  Jim Hefferon committed Jan 20, 2012 329  numeric whisker_width; whisker_width=.4v;  Jim Hefferon committed Jan 19, 2012 330 331 332  pickup pencircle scaled line_width_light; drawpoint(z10); pickup pensquare scaled line_width_light;  Jim Hefferon committed Apr 16, 2014 333 334 335  draw (x10,y10+0.5v)--(x10,y4-0.5v) withcolor shading_color; % vert line above dot draw (x10-.5whisker_width,y4-0.5v)--(x10+.5whisker_width,y4-0.5v) withcolor shading_color; % whisker at top draw (x10-.5whisker_width,y10+0.5v)--(x10+.5whisker_width,y10+0.5v) withcolor shading_color; % whisker at bot  Jim Hefferon committed Nov 09, 2013 336  label.rt(btex \small $\nullity (t^j)$ etex,(x10,.5[y10,y4]));  Jim Hefferon committed Apr 16, 2014 337 338 339  draw (x10,y10-0.5v)--(x10,1v) withcolor shading_color; % vert line below dot draw (x10-.5whisker_width,y10-0.5v)--(x10+.5whisker_width,y10-0.5v) withcolor shading_color; % whisker at top draw (x10-.5whisker_width,1v)--(x10+.5whisker_width,1v) withcolor shading_color; % whisker at bot  Jim Hefferon committed Nov 09, 2013 340  label.lft(btex \small $\rank (t^j)$ etex,(x10,.55[y10,1v]));  Jim Hefferon committed Jan 19, 2012 341 342 343 344  pickup pencircle scaled line_width_light; drawpoint((1w,9v)); drawpoint((2w,7v)); drawpoint((3w,6v));  Jim Hefferon committed Jan 20, 2012 345  drawpoint((17w,2.2v));  Jim Hefferon committed Jan 19, 2012 346 347 348  drawpoint((18w,2v)); drawpoint((19w,2v)); drawpoint((20w,2v));  Jim Hefferon committed Jan 20, 2012 349  % drawpoint((21w,2v));  Jim Hefferon committed Nov 09, 2013 350  label(btex \small $\ldots$ etex,(21w,2v));  Jim Hefferon committed Jan 20, 2012 351 352 353  % Generalized spaces z20=(20w,2v); % were to anchor the line for generalized spaces pickup pensquare scaled line_width_light;  Jim Hefferon committed Apr 16, 2014 354 355 356  draw (x20,y20+0.5v)--(x20,y4-0.5v) withcolor shading_color; % vert line above dot draw (x20-.5whisker_width,y4-0.5v)--(x20+.5whisker_width,y4-0.5v) withcolor shading_color; % whisker at top draw (x20-.5whisker_width,y20+0.5v)--(x20+.5whisker_width,y20+0.5v) withcolor shading_color; % whisker at bot  Jim Hefferon committed Nov 09, 2013 357  label.rt(btex \small $\dim(\gennullspace{t})$ etex,(x20,.5[y20,y4]));  Jim Hefferon committed Nov 17, 2013 358  draw (x20,y20-0.5v)--(x20,1v) withcolor medgray; % vert line below dot  Jim Hefferon committed Apr 16, 2014 359 360  draw (x20-.5whisker_width,y20-0.5v)--(x20+.5whisker_width,y20-0.5v) withcolor shading_color; % whisker at top draw (x20-.5whisker_width,1v)--(x20+.5whisker_width,1v) withcolor shading_color; % whisker at bot  Jim Hefferon committed Nov 09, 2013 361  label.rt(btex \small $\dim(\genrangespace{t})$ etex,(x20,.8[y20,1v]));  Jim Hefferon committed Jan 19, 2012 362 363 364 endfig;  Jim Hefferon committed Feb 24, 2012 365 366 367 368 369 370 371 372 373  %-------------------------------- % Topic: Page Rank % Graph illustrating page links % beginfig(9); % m %numeric u; %scaling factor %numeric v; %vertical scaling factor %numeric w; %horizontal scaling factor  Jim Hefferon committed Feb 28, 2012 374  numeric circlescale; circlescale=19pt;  Jim Hefferon committed Feb 24, 2012 375 376 377 378 379  path node; node=fullcircle scaled circlescale; path n[]; % node paths pickup pencircle scaled line_width_light; z1=(0w,6v); n1=node shifted z1;  Jim Hefferon committed Feb 28, 2012 380  draw n1; label(btex \small $p_1$ etex,z1);  Jim Hefferon committed Feb 24, 2012 381 382  z2=(9w,y1); n2=node shifted z2;  Jim Hefferon committed Feb 28, 2012 383  draw n2; label(btex \small $p_2$ etex,z2);  Jim Hefferon committed Feb 24, 2012 384 385  z3=(x2,0v); n3=node shifted z3;  Jim Hefferon committed Feb 28, 2012 386  draw n3; label(btex \small $p_3$ etex,z3);  Jim Hefferon committed Feb 24, 2012 387 388  z4=(x1,y3); n4=node shifted z4;  Jim Hefferon committed Feb 28, 2012 389  draw n4; label(btex \small $p_4$ etex,z4);  Jim Hefferon committed Feb 24, 2012 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414  path p[], q[]; pair times[]; % intersection times % arrow from p1 to p2 p12=z1--z2; times121=p12 intersectiontimes n1; times122=p12 intersectiontimes n2; drawarrow subpath(xpart(times121)+.05,xpart(times122)-.05) of p12; % arrow from p2 to p3 p23=z2--z3; times232=p23 intersectiontimes n2; times233=p23 intersectiontimes n3; drawdblarrow subpath(xpart(times232)+.05,xpart(times233)-.05) of p23; % arrow from p3 to p1 p31=z3--z1; times313=p31 intersectiontimes n3; times311=p31 intersectiontimes n1; drawarrow subpath(xpart(times313)+.05,xpart(times311)-.05) of p31; % arrow from p3 to p4 p34=z3--z4; times343=p34 intersectiontimes n3; times344=p34 intersectiontimes n4; drawarrow subpath(xpart(times343)+.05,xpart(times344)-.05) of p34; endfig;  Jim Hefferon committed Feb 28, 2012 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 % Exercise from KURT BRYAN AND TANYA LEISE % beginfig(10); % m %numeric u; %scaling factor %numeric v; %vertical scaling factor %numeric w; %horizontal scaling factor numeric circlescale; circlescale=19pt; path node; node=fullcircle scaled circlescale; path n[]; % node paths pickup pencircle scaled line_width_light; z1=(0w,6v); n1=node shifted z1; draw n1; label(btex \small $p_1$ etex,z1); z2=(9w,y1); n2=node shifted z2; draw n2; label(btex \small $p_2$ etex,z2); z3=(x2,0v); n3=node shifted z3; draw n3; label(btex \small $p_3$ etex,z3); z4=(x1,y3); n4=node shifted z4; draw n4; label(btex \small $p_4$ etex,z4); path p[], q[]; pair times[]; % intersection times % arrow from p1 to p2 p12=z1--z2; times121=p12 intersectiontimes n1; times122=p12 intersectiontimes n2; drawarrow subpath(xpart(times121)+.05,xpart(times122)-.05) of p12; % arrow from p1 to p3 p13=z1--z3; times131=p13 intersectiontimes n1; times133=p13 intersectiontimes n3; drawdblarrow subpath(xpart(times131)+.05,xpart(times133)-.05) of p13; % arrow from p1 to p4 p14=z1--z4; times141=p14 intersectiontimes n1; times144=p14 intersectiontimes n4; drawdblarrow subpath(xpart(times141)+.05,xpart(times144)-.05) of p14; % arrow from p2 to p3 p23=z2--z3; times232=p23 intersectiontimes n2; times233=p23 intersectiontimes n3; drawarrow subpath(xpart(times232)+.05,xpart(times233)-.05) of p23; % arrow from p2 to p4 p24=z2--z4; times242=p24 intersectiontimes n2; times244=p24 intersectiontimes n4; drawarrow subpath(xpart(times242)+.05,xpart(times244)-.05) of p24; % arrow from p4 to p5 p43=z4--z3; times433=p43 intersectiontimes n4; times434=p43 intersectiontimes n3; drawarrow subpath(xpart(times433)+.05,xpart(times434)-.05) of p43; endfig;  Jim Hefferon committed Mar 01, 2012 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 % Search: every site points in a circle % beginfig(11); % %numeric u; %scaling factor %numeric v; %vertical scaling factor %numeric w; %horizontal scaling factor numeric circlescale; circlescale=19pt; path node; node=fullcircle scaled circlescale; path n[]; % node paths pickup pencircle scaled line_width_light; z1=(0w,6v); n1=node shifted z1; draw n1; label(btex \small $p_1$ etex,z1); z2=(9w,y1); n2=node shifted z2; draw n2; label(btex \small $p_2$ etex,z2); z3=(x2,0v); n3=node shifted z3; draw n3; label(btex \small $p_3$ etex,z3); z4=(x1,y3); n4=node shifted z4; draw n4; label(btex \small $p_4$ etex,z4); path p[], q[]; pair times[]; % intersection times % arrow from p1 to p2 p12=z1--z2; times121=p12 intersectiontimes n1; times122=p12 intersectiontimes n2; drawarrow subpath(xpart(times121)+.05,xpart(times122)-.05) of p12; % arrow from p2 to p3 p23=z2--z3; times232=p23 intersectiontimes n2; times233=p23 intersectiontimes n3; drawarrow subpath(xpart(times232)+.05,xpart(times233)-.05) of p23; % arrow from p3 to p4 p34=z3--z4; times343=p34 intersectiontimes n3; times344=p34 intersectiontimes n4; drawarrow subpath(xpart(times343)+.05,xpart(times344)-.05) of p34; % arrow from p4 to p1 p41=z4--z1; times414=p41 intersectiontimes n4; times411=p41 intersectiontimes n1; drawarrow subpath(xpart(times414)+.05,xpart(times411)-.05) of p41; endfig;  Jim Hefferon committed Feb 28, 2012 517   Jim Hefferon committed Feb 24, 2012 518 519   Jim Hefferon committed Dec 05, 2011 520 end