summaryrefslogtreecommitdiff
path: root/info/examples/lgc2/3-6-1.mp
blob: 18c263691d2ea91268dcb3b43323915648b2a2e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
% --- start of displayed preamble in the book ---

verbatimtex
%&latex
\documentclass{article}
\begin{document}
etex
input graph
% --- end of displayed preamble in the book ---
defaultfont:="ptmr8r";
warningcheck:=0;
beginfig(1)
draw begingraph(250,150);
  pickup pencircle scaled 1pt;
  path p;
  for x=-20 step 0.2 until -0.2:
    augment.p (x, sind(x*180/3.14159)/x);
  endfor;
  augment.p (0, 1);
  for x=0.2 step 0.2 until 20:
    augment.p (x, sind(x*180/3.14159)/x);
  endfor;
  glabel.lrt(btex $\displaystyle\frac{\sin(x)}{x}$ etex,(-20,1));
  gdraw p;
endgraph
endfig;
end;