home *** CD-ROM | disk | FTP | other *** search
- Program Spokes;
-
- { A simple graphics demonstration using the hires screen. This program }
- { uses the external function LINE.INV which must reside on the default }
- { drive in order to compile the program. Jeff Firestone June, 1984. }
-
- Var
- v, h, s, c, angle, radians : real;
- n, x, y, sx, sy, cx, cy : integer;
-
-
- Procedure Line(a,b,c,d,e:integer); External 'Line.INV';
-
-
- begin
- Write('Number of spokes on wheel : ');
- read(n); writeln;
- write('Size (245) : ');
- read(h); writeln;
- v:= h * 0.4;
- s:= 280;
- c:= 100;
- angle:= 360 / n;
- radians:= angle / 57.29578;
- hires; hiresColor(7);
- for x:= 1 to n do
- for y:= x to n do
- begin
- sx:= round(sin(x * radians) * h + s);
- sy:= round(sin(y * radians) * h + s);
- cx:= round(cos(x * radians) * v + c);
- cy:= round(cos(y * radians) * v + c);
- line(sy, cy, sx, cx, 1);
- end;
- readln;
- end.