Debian Codegraph @

examples/spiralbox

raw
1 #!/usr/bin/perl
2 use Graphics::Libplot ':ALL';
3
4 # type of plotting device
5 $device = 'X';
6 if (@ARGV) {
7 $device = $ARGV[0];
8 # die "Uknown device: $ARGV[0]" unless $ARGV[0] =~ /^ps|X|fig$/;
9 }
10
11 { # environment for local variables
12
13 my $SIZE=100;
14 my ($i,$f,$s,$sf);
15 pl_parampl ("BITMAPSIZE", "700x700");
16 $handle = pl_newpl($device, stdin, stdout, stderr); # open xwindow display
17 pl_selectpl($handle);
18 pl_openpl();
19 pl_fspace(-$SIZE,-$SIZE, $SIZE, $SIZE); # specify user coord system
20 pl_pencolorname ("blue");
21 pl_fontname("HersheySerif");
22 $s = 10;
23 $f = 10;
24 $sf = 1- .0012;
25 for($i=1;$i<3000;$i++){
26 pl_fscale($sf,$sf);
27 pl_fbox(60+$s*sin($i/$f),
28 60+$s*sin($i/$f),
29 75-$s*cos($i/$f),
30 75-$s*cos($i/$f));
31 pl_frotate(1);
32 }
33
34 }
35 pl_closepl();
36 pl_selectpl(0);
37 pl_deletepl($handle);
38
39 1; #OK
40