{$n+}
unit makes;

interface

procedure makesurf1 (w : word;MaxColor : byte);
procedure makesurf2 (w : word;MaxColor : byte);
procedure makesurf3 (w : word;MaxColor : byte);
procedure makesurf4 (w : word;MaxColor : byte);
procedure makesurf5 (w : word;MaxColor : byte);
procedure makesurf6 (w : word;MaxColor : byte);

Implementation

Type
 TpointList = record
               x,y : integer;
              End;

var
i,x,y,backpage : word;
PointList : Array [1..32] of TPointList;
maxdist,dist      : single;
points            : byte;

procedure setpoint (n,x,y : integer);
Begin
PointList[n].x:=x;
PointList[n].y:=y;
inc (points);
End;


procedure MakeSurf1;
Begin
points:=0;
SetPoint (1,80,100);
SetPoint (2,240,100);

maxdist:=0;
for x:=0 to 319 do
for y:=0 to 199 do begin

dist:=0;
for i:=1 to points do dist:=dist+SQRT(SQR(x-Pointlist[i].x)+Sqr(Y-Pointlist[i].y));
dist:=dist/points;
if maxdist<dist then maxdist:=dist;
End;

for x:=0 to 319 do
for y:=0 to 199 do begin

dist:=0;
for i:=1 to points do dist:=dist+SQRT(SQR(x-Pointlist[i].x)+Sqr(Y-Pointlist[i].y));
dist:=dist/points;
mem[w:y*320+x]:=MaxColor-round(MaxColor/maxdist*dist);
End;
end;

procedure MakeSurf2;
Begin
points:=0;
SetPoint (1,80,100);
SetPoint (2,240,100);

maxdist:=0;
for x:=0 to 319 do
for y:=0 to 199 do begin

dist:=0;
for i:=1 to points do dist:=dist+SQRT(SQR(x-Pointlist[i].x)+Sqr(Y-Pointlist[i].y));
dist:=dist/points;
if maxdist<dist then maxdist:=dist;
End;

for x:=0 to 319 do
for y:=0 to 199 do begin

dist:=0;
for i:=1 to points do dist:=dist+SQRT(SQR(x-Pointlist[i].x)+Sqr(Y-Pointlist[i].y));
dist:=dist/points;
mem[w:y*320+x]:={MaxColor-round(MaxColor/maxdist*dist)+}random(256);
End;
end;

procedure MakeSurf3;
Begin
points:=0;
SetPoint (1,80,100);
SetPoint (2,240,100);

maxdist:=0;
for x:=0 to 319 do
for y:=0 to 199 do begin

dist:=0;
for i:=1 to points do dist:=dist+SQRT(SQR(x-Pointlist[i].x)+Sqr(Y-Pointlist[i].y));
dist:=dist/points;
if maxdist<dist then maxdist:=dist;
End;

for x:=0 to 319 do
for y:=0 to 199 do begin

dist:=0;
for i:=1 to points do dist:=dist+SQRT(SQR(x-Pointlist[i].x)+Sqr(Y-Pointlist[i].y));
dist:=dist/points;
mem[w:y*320+x]:=MaxColor-round(MaxColor/maxdist*dist)+random(64);
End;
end;

procedure MakeSurf4;
var
o : word;
Begin
points:=0;
randomize;
for o:=1 to 10 do setpoint (o,random(320),random(200));

maxdist:=0;
for x:=0 to 319 do
for y:=0 to 199 do begin

dist:=0;
for i:=1 to points do dist:=dist+SQRT(SQR(x-Pointlist[i].x)+Sqr(Y-Pointlist[i].y));
dist:=dist/points;
if maxdist<dist then maxdist:=dist;
End;

for x:=0 to 319 do
for y:=0 to 199 do begin

dist:=0;
for i:=1 to points do dist:=dist+SQRT(SQR(x-Pointlist[i].x)+Sqr(Y-Pointlist[i].y));
dist:=dist/points;
mem[w:y*320+x]:=MaxColor-round(MaxColor/maxdist*dist)+random(64);
End;
end;

procedure MakeSurf5;
var
o : word;
Begin
points:=0;
randomize;
setpoint (1,160,100);


maxdist:=0;
for x:=0 to 319 do
for y:=0 to 199 do begin

dist:=0;
for i:=1 to points do dist:=dist+SQRT(SQR(x-Pointlist[i].x)+Sqr(Y-Pointlist[i].y));
dist:=dist/points;
if maxdist<dist then maxdist:=dist;
End;

for x:=0 to 319 do
for y:=0 to 199 do begin

dist:=0;
for i:=1 to points do dist:=dist+SQRT(SQR(x-Pointlist[i].x)+Sqr(Y-Pointlist[i].y));
dist:=dist/points;
mem[w:y*320+x]:=round(MaxColor/maxdist*dist){+random(64)};
End;
end;

procedure MakeSurf6;
var
o : word;
Begin
points:=0;
{setpoint (1,0,0);
setpoint (2,0,199);
setpoint (3,320,0);
setpoint (4,320,200);}
setpoint (1,160,100);

maxdist:=0;
for x:=0 to 319 do
for y:=0 to 199 do begin

dist:=0;
for i:=1 to points do dist:=dist+SQRT(SQR(x-Pointlist[i].x)+Sqr(Y-Pointlist[i].y));
dist:=dist/points;
if maxdist<dist then maxdist:=dist;
End;

for x:=0 to 319 do
for y:=0 to 199 do begin

dist:=0;
for i:=1 to points do dist:=dist+SQRT(SQR(x-Pointlist[i].x)+Sqr(Y-Pointlist[i].y));
dist:=dist/points;
mem[w:y*320+x]:=round(MaxColor/maxdist*dist)+random(64);
End;
end;

Begin
End.
