home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / graphics / draw630.lbr / WEB.PQS / WEB.PAS
Encoding:
Pascal/Delphi Source File  |  1986-12-07  |  1.4 KB  |  42 lines

  1. PROGRAM ConnectedWeb;
  2.  
  3. VAR
  4.   a0,r0,d,a9,a,r,x,y : real;
  5.   i,j,k,l,n,p : integer;
  6. {$i diablo.lib }
  7.  
  8. BEGIN
  9.   writeln('This program, connected web, was developed and coded by');
  10.   writeln('Joe Jacobson, and is based on a suggestion by Chris');
  11.   writeln('Kuebler. Parameter N gives the # of vertices. P gives the');
  12.   writeln('# of imaginary tic markes on each vertex axis. A0 is the');
  13.   writeln('initial rotation angle. R0 is the overall radius. The');
  14.   writeln('overlay enhances the picture. For example, try:');
  15.   writeln('(N,P,A0,R0)=(16,20,0,50) and request an overlay when asked.');
  16.   writeln('This gives a fairly neat pattern.');
  17.   writeln;
  18.   write('Enter N,P,A0,R0.  ');
  19.   readln(n,p,a0,r0);
  20.   write('Enter 1 for single pattern, 2 for overlay.');
  21.   readln(k);
  22.   d := r0/p;
  23.   a9 := 360/n;
  24.   init_diablo;
  25.   FOR l := 1 TO k DO
  26.     BEGIN
  27.       FOR i := 0 TO p-1 DO
  28.         FOR j := 0 TO n DO
  29.           BEGIN
  30.             a := (a0+j*a9)*3.141592/180;
  31.             r := ((p-i)*(j and 1)+(i+1)*((j+1) and 1))*(d);
  32.             x := (250+r*cos(a));
  33.             y := (250+r*sin(a));
  34.             IF j=0 THEN
  35.               plot(round(x),round(y))
  36.             ELSE
  37.               drawto(round(x),round(y))
  38.           END;
  39.       a0 := a0 + a9/2
  40.     END;
  41.   reset_diablo
  42. END.