[comp.text] Drawing a large circle in LaTeX

mathieu@yunexus.UUCP (Pierre Mathieu) (10/14/89)

I am trying to get LaTeX to give me a large circle in \picture mode, 
larger than the largest which it appears to accept, apparently 40pt.
I would like to know if anyone has suggestions on the best way to proceed.
What I want is basically an 80pt circle.

I have tried using the TeXbook \path macro, which appears on page 390,
and producing new arcs in the lcircle10 font using METAFONT in the 
following way:

1) I used the \path macro. Note the use of the lcircle10 font
   and the characters 50, 51, 52, and 53 (40, 41, 42, 43 in decimal). 
   These are the new characters I tried to create with METAFONT 
   (see item 2). The biggest arcs provided in lcircle10 where 
   characters 44, 45, 46, and 47 (36, 37, 38, 39 in decimal).

%
% Path macro from TeXbook, p.390.
%
\font\qc=lcircle10
\catcode`\ =9 \endlinechar=-1 %ignore all spaces (temporarily)
\newcount\dir \newdimen\y \newdimen\w
\newif\ifvisible \let\B=\visibletrue \let\W=\visiblefalse
\newbox\NE \newbox\NW \newbox\SE \newbox\SW \newbox\NS \newbox\EW
\setbox\SW=\hbox{\qc \char'50} \setbox\NW=\hbox{\qc \char'51}
\setbox\NE=\hbox{\qc \char'52} \setbox\SE=\hbox{\qc \char'53}
\w=\wd\SW \dimen0=\fontdimen8\qc
\setbox\EW=\hbox{\kern-\dp\SW \vrule height\dimen0 width\wd\SW} \wd\EW=\w
\setbox\NS=\hbox{\vrule height\ht\SW depth\dp\SW width\dimen0} \wd\NS=\w
\def\L{\ifcase\dir \dy+\NW \or\dx-\SW \or\dy-\SE \or\dx+\NE\dd-4\fi \dd+1}
\def\S{\ifcase\dir \dx+\EW \or\dy+\NS \or\dx-\EW \or\dy-\NS \fi}
\def\R{\ifcase\dir \dy-\SW\dd+4 \or\dx+\SE \or\dy+\NE \or\dx-\NW\fi \dd-1}
\def\T{\ifcase\dir\kern-\w\dd+2\or\ey-\dd+2\or\kern\w\dd-2\or\ey+\dd-2\fi}
\edef\dd#1#2{\global\advance\dir#1#2\space}
\def\dx#1#2{\ifvisible\raise\y\copy#2 \if#1-\kern-2\w\fi\else\kern#1\w\fi}
\def\dy#1#2{\ifvisible\raise\y\copy#2 \kern-\w \fi \global\advance\y#1\w}
\def\ey#1{\global\advance\y#1\w}
\def\path#1{\hbox{\B \dir=0 \y=0pt #1}}
\catcode`\ =10 \endlinechar=`\^^M % resume normal spacing conventions

\newcount\n % the current order in the \dragon and \nogard macros
\def\dragon{\ifnum\n>0{\advance\n-1 \dragon\L\nogard}\fi}
\def\nogard{\ifnum\n>0{\advance\n-1 \dragon\R\nogard}\fi}


2) I then modified the METAFONT source for lcircle10 by adding the lines
   below, in the hope of creating 40pt arcs and, when pieced together
   with \path, an 80pt circle.


cmchar "40pt, top right";
qbeginchar(40,80pt#);
numeric delta;
pickup nib;
arcs;
draw z7{right}..z6{downright}..z5{down};
endchar;

cmchar "40pt, bottom right";
qbeginchar(41,80pt#);
numeric delta;
pickup nib;
arcs;
draw z1{down}..z8{downleft}..z7{left};
endchar;

cmchar "40pt, bottom left";
qbeginchar(42,80pt#);
numeric delta;
pickup nib;
arcs;
draw z3{left}..z2{upleft}..z1{up};
endchar;

cmchar "40pt, top left";
qbeginchar(43,80pt#);
numeric delta;
pickup nib;
arcs;
draw z5{up}..z4{upright}..z3{right};
endchar;


3) I also tried adding a straight 80pt circle in the lcircle10 font.

cmchar "80pt, circle";
beginchar(111,80pt#,0pt#,0pt#);
pickup nib;
draw fullcircle scaled w;
endchar;




Well, after running METAFONT and creating a new lcircle10.300gf font file,
I found that the above steps didn't work. Neither the new arcs nor the 80 pt 
circle showed up when I used the \path command in my code. HOWEVER, if I 
used some of the original font characters such as 44, 45, 46, 47, \path
would draw the circle of the right size quite nicely.

	Result, I'm confused. What am I doing wrong? Is there an easier
way of getting a large circle. HELP!


-----
			   
Pierre Mathieu            
CRESS, York University,  
Ontario, Canada         
mathieu@clid.yorku.ca 

beck@skuld.cs.cornell.edu (Micah Beck) (10/16/89)

In article <4369@yunexus.UUCP> mathieu@yunexus.UUCP (Pierre Mathieu) writes:
>I am trying to get LaTeX to give me a large circle in \picture mode, 
>larger than the largest which it appears to accept, apparently 40pt.
>I would like to know if anyone has suggestions on the best way to proceed.
>What I want is basically an 80pt circle.

The easiest way to so this is to use some LaTeX graphics mechanism which
does not rely on fixed size circle fonts to draw circles.

The simplest is PiCTeX, which draws circles with a whole lot of period
characters ('.'), but may run out of TeX memory.

EEPIC is a package which produces special graphics commands (tpic specials)
in the DVI file and must be used with DVI drivers which support them.

Most of these are avaiable by anonymous FTP from svax.cs.cornell.edu
in directory ~ftp/pub/tex-figures.  However the PiCTeX manual must be
purchased from TUG at a cost of $30, I think.

Micah Beck
Cornell CS