Реферат: Исследование и моделирование с помощью компьютера электрических полей
Procedure DrawGrid;
Var I:Integer;
Begin
Form1.Canvas.Pen.Color:=clWhite; I:=0;
While (I<=Form1.Width) and (I<1601) do begin
Form1.Canvas.MoveTo(I,0);
Form1.Canvas.LineTo(I,Form1.Height);
Inc(I,25);
end; I:=0;
While (I<=Form1.Height) and (I<1201) do begin
Form1.Canvas.MoveTo(0,I);
Form1.Canvas.LineTo(Form1.Width,I);
Inc(I,25);
end;
End;
Procedure RefreshSquare(X,Y:Byte);
Begin
Form1.Canvas.Pen.Color:=clBlack;
Form1.Canvas.Brush.Color:=clBlack; Circle(X*25+13,Y*25+13,12,0);
RefreshStatus(X,Y);
If Qc[X,Y]=0 then Exit;
Form1.Canvas.Pen.Color:=clWhite;
If Qc[X,Y]>0 then Form1.Canvas.Brush.Color:=clRed
else Form1.Canvas.Brush.Color:=clBlue;
Circle(X*25+13,Y*25+13,Abs(4*Qc[X,Y])-1,0);
End;
Procedure Circle(X,Y,R:Real;W:Byte);
Begin
If W=0 then Form1.Canvas.Ellipse(Round(X-R),Round(Y-R),Round(X+R),Round(Y+R));