6 devarc(double x1, double y1, double x2, double y2, double xc, double yc, int r)
11 /* tpic arcs go clockwise, and angles are measured clockwise */
12 start = atan2(y2-yc, x2-xc);
13 stop = atan2(y1-yc, x1-xc);
15 t = start; start = stop; stop = t;
17 rad = SCX(sqrt((x1-xc)*(x1-xc)+(y1-yc)*(y1-yc)));
18 fprintf(TEXFILE, " \\special{ar %d %d %d %d %6.3f %6.3f}%%\n",
19 TRX(xc), TRY(yc), rad, rad, -start, -stop);
23 box(double x0, double y0, double x1, double y1)
25 fprintf(TEXFILE," \\special{pa %d %d}",TRX(x0),TRY(y0));
26 fprintf(TEXFILE,"\\special{pa %d %d}",TRX(x1),TRY(y0));
27 fprintf(TEXFILE,"\\special{pa %d %d}",TRX(x1),TRY(y1));
28 fprintf(TEXFILE,"\\special{pa %d %d}",TRX(x0),TRY(y1));
29 fprintf(TEXFILE,"\\special{pa %d %d}",TRX(x0),TRY(y0));
32 fprintf(TEXFILE,"\\special{da %6.3f}%%\n", e1->dashlen); break;
34 fprintf(TEXFILE,"\\special{dt %6.3f}%%\n", e1->dashlen); break;
37 fprintf(TEXFILE,"\\special{fp}%%\n"); break;
42 circle(double xc, double yc, double r)
46 fprintf(TEXFILE, " \\special{ar %d %d %d %d 0.0 6.2832}%%\n",
47 TRX(xc), TRY(yc), rad, rad);
53 fprintf(TEXFILE, " \\kern %6.3fin\n }\\vss}%%\n", INCHES(e1->sidex));
54 fprintf(TEXFILE, " \\kern %6.3fin\n}\n", INCHES(e1->sidey));
58 disc(double xc, double yc, double r)
60 fprintf(TEXFILE, " \\special{bk}%%\n");
70 fill(int num[], double *ff[])
72 double *xp, *yp, **fp, x0, y0;
87 if (*(xp-2) != x0 || *(yp-2) != y0)
93 frame(double xs, double ys, double xf, double yf)
95 double osidex, osidey;
98 e1->left = xs * (e0->left + e0->sidex);
99 e1->bottom = ys* (e0->bottom + e0->sidey);
100 e1->sidex = (xf-xs) * e0->sidex;
101 e1->sidey = (yf-ys) * e0->sidey;
102 e1->scalex *= (e1->sidex / osidex);
103 e1->scaley *= (e1->sidey / osidey);
107 line(double x0, double y0, double x1, double y1)
114 move(double xx, double yy)
120 extern double xmin, ymin, xmax, ymax;
122 /* tpic TeX coord system uses millinches, printer's points for pensize */
123 /* positive y downward, origin at upper left */
125 #define pHEIGHT 5000.
130 struct penvir E[2] = {
131 {0.,pHEIGHT,0.,0.,1.,-1.,pWIDTH,pHEIGHT,0.,0.,0,pPSIZE,SOLIDPEN,pPENSIZE,pDLEN},
132 {0.,pHEIGHT,0.,0.,1.,-1.,pWIDTH,pHEIGHT,0.,0.,0,pPSIZE,SOLIDPEN,pPENSIZE,pDLEN}
134 struct penvir *e0 = E, *e1 = &E[1];
142 space(xmin, ymin, xmax, ymax);
143 fprintf(TEXFILE,"\\catcode`@=11\n");
144 fprintf(TEXFILE, "\\expandafter\\ifx\\csname graph\\endcsname\\relax");
145 fprintf(TEXFILE, " \\alloc@4\\box\\chardef\\insc@unt\\graph\\fi\n");
146 fprintf(TEXFILE, "\\catcode`@=12\n");
147 fprintf(TEXFILE, "\\setbox\\graph=\\vtop{%%\n");
148 fprintf(TEXFILE, " \\baselineskip=0pt \\lineskip=0pt ");
149 fprintf(TEXFILE, "\\lineskiplimit=0pt\n");
150 fprintf(TEXFILE, " \\vbox to0pt{\\hbox{%%\n");
151 fprintf(TEXFILE, " \\special{pn %d}%%\n", e1->pdiam);
155 range(double x0, double y0, double x1, double y1)
159 if (x1-x0 < .0000001*e1->sidex)
161 if (y1-y0 < .0000001*e1->sidey)
163 e1->scalex = e0->scalex*e1->sidex / (x1 - x0);
164 e1->scaley = e0->scaley*e1->sidey / (y1 - y0);
168 rmove(double xx, double yy)
175 rvec(double xx, double yy)
177 vec(xx+e1->copyx, yy+e1->copyy);
181 sbox(double x0, double y0, double x1, double y1)
183 fprintf(TEXFILE," \\special{bk}%%\n");
188 vec(double xx, double yy)
190 fprintf(TEXFILE," \\special{pa %d %d}",TRX(e1->copyx),TRY(e1->copyy));
193 fprintf(TEXFILE,"\\special{pa %d %d}",TRX(xx),TRY(yy));
196 fprintf(TEXFILE,"\\special{da %6.3f}%%\n", e1->dashlen); break;
198 fprintf(TEXFILE,"\\special{dt %6.3f}%%\n", e1->dashlen); break;
201 fprintf(TEXFILE,"\\special{fp}%%\n"); break;