1 /* Loglan82 Compiler&Interpreter
\r
2 Copyright (C) 1981-1993 Institute of Informatics, University of Warsaw
\r
3 Copyright (C) 1993, 1994 LITA, Pau
\r
5 This program is free software; you can redistribute it and/or modify
\r
6 it under the terms of the GNU General Public License as published by
\r
7 the Free Software Foundation; either version 2 of the License, or
\r
8 (at your option) any later version.
\r
10 This program is distributed in the hope that it will be useful,
\r
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 GNU General Public License for more details.
\r
15 =======================================================================
\r
20 #define isign(k, i) (((i) >= 0) ? (k) : -(k))
21 #define iabs(i) ((i) >= 0 ? (i) : -(i))
22 #define sqr(x) ((x)*(x))
23 #define min0(x, y) ((x) < (y) ? (x) : (y))
24 #define max0(x, y) ((x) > (y) ? (x) : (y))
26 #define alf(i) alf_[i]
32 #define min(i) min_[i]
33 #define max(i) max_[i]
35 #define mx1(i) mx1_[i]
36 #define incr1(i) incr1_[i]
37 #define incr2(i) incr2_[i]
42 #define bxy(i) bxy_[i]
44 #define g(i,j) g_[i][j]
45 #define go(i,j) go_[i][j]
50 #define INT(x) ((int) (x))
51 #define FLOAT(x) ((float) (x))
52 #define SIN(x) sin((double) (x))
53 #define COS(x) cos((double) (x))
54 #define SQRT(x) sqrt((double) (x))
59 void pascal cirb(xi, yi, ri, alfa, beta, cbord, bcint, p, q)
62 int *cbord, *bcint, *p, *q;
64 extern void pascal wyc47();
66 wyc47(*xi, *yi, (double) *ri, (double) *alfa, (double) *beta,
67 *cbord, *bcint, pa*(*p), qa*(*q), (double) 1.0);
70 /***********************************************************************
71 void pascal rcirb(xr, yr, r, alfa, beta, cbord, bcint, p, q)
72 float *xr, *yr, *r, *alfa, *beta;
73 int *cbord, *bcint, *p, *q;
75 extern void pascal wyc47();
76 extern float mix, miy, sxx, syy;
79 wyc47(mii+INT(sxx*(*xr-mix)), maj-INT(syy*(*yr-miy)), (double) *r,
80 (double) *alfa, (double) *beta,
81 *cbord, *bcint, pa*(*p), qa*(*q), (double) sxx);
83 ***********************************************************************/
85 void pascal wyc47(ir, jr, r, alfa, beta, cbord, bcint, p, q, cx)
88 int cbord, bcint, p, q;
91 extern double sin(), cos(), sqrt();
92 extern void pascal move(), pascal hfill(), pascal pushxy(),
93 pascal popxy(), pascal color(), pascal style();
95 float alfj,qasp,pr,a,s,c;
97 long p1,q1,p2,q2,p4,q4,u,v,w,d1;
98 int i,j,j1,j2,j3,k,l,n,m,m1,m2,ri,x,y,py,px1,
99 px2,sxi,sy1,sy2,xi,dj,dxj,dyj,inc1,
101 int ix(2+1),iy(2+1),sx(2+1),sy(3+1),d(2+1),min(5+1),max(5+1),
102 mx(2+1),mx1(2+1),incr1(2+1),incr2(2+1),ip(2+1),sj(2+1),
103 sc(3+1),g(3+1,2+1),go(3+1,2+1);
104 logical bl(2+1),bxy(2+1),bp(3+1);
118 for (i=1; i <= 3; i++)
121 for (j=1; j <= 2; j++)
141 for (j=1; j <= 2; j++)
146 a=pr/SQRT(sqr(p*c)+sqr(qasp*s));
169 if (isign(1,m) > 0) {
197 for (j=1; j <= 2; j++)
207 incr2(j)=2*(dxj-dyj);
212 incr2(j)=2*(dyj-dxj);
228 L300: for (j=1; j <= 2; j++)
239 if (xi >= m) bl(j)=TRUE;
260 if (y == iy(j)) bl(j)=TRUE;
264 for (i=1; i <= n; i++)
278 if ((j == 4 || j == 5) && bl(j3)) {
280 if (sy(j3) == sj(j3)*sx(j3)) {
283 max(j)=max0(max(3),m);
292 min(j3)=min0(min(j3),min(3));
296 for (l=1; l <= 2; l++)
302 min(j)=min0(min(j),min(3));
309 for (l=1; l <= 2; l++)
357 if (bp(1) && bp(2) && bp(3)) return;
391 if (x > 0) goto L250;