Математическое моделирование физических задач на ЭВМ
Информация - Физика
Другие материалы по предмету Физика
v 5,y+Sy Div 2,x+Sx,y+Sy Div 2);
PlotLIne (x+Sx*2 Div 5,y+Sy Div 8,x+Sx*2 Div 5,y+Sy*7 Div 8);
PlotLIne (x+Sx*3 Div 5,y+Sy Div 3,x+Sx*3 Div 5,y+Sy*2 Div 3);
End;
Procedure _5(x,y:Integer);
Begin
PlotLIne (x+Sx Div 2,y,x+Sx Div 2,y+Sy*2 Div 5);
PlotLIne (x+Sx Div 2,y+Sy*3 Div 5,x+Sx Div 2,y+Sy);
PlotLIne (x+Sx Div 8,y+Sy*2 Div 5,x+Sx*7 Div 8,y+Sy*2 Div 5);
PlotLIne (x+Sx Div 3,y+Sy*3 Div 5,x+Sx*2 Div 3,y+Sy*3 Div 5);
End;
Procedure _6(x,y:Integer);
Begin
PlotLIne (x+Sx Div 2,y,x+Sx Div 2,y+Sy*2 Div 5);
PlotLIne (x+Sx Div 2,y+Sy*3 Div 5,x+Sx Div 2,y+Sy);
PlotLIne (x+Sx Div 8,y+Sy*3 Div 5,x+Sx*7 Div 8,y+Sy*3 Div 5);
PlotLIne (x+Sx Div 3,y+Sy*2 Div 5,x+Sx*2 Div 3,y+Sy*2 Div 5);
End;
Procedure _7(x,y:Integer);
Begin
PlotLIne(x,y+Sy Div 2,x+sx Div 5,y+Sy Div 2);
PlotLIne(x+sx*4 Div 5,y+Sy Div 2,x+sx,y+Sy Div 2);
PlotLIne(x+sx Div 5,y+Sy*12 Div 20,x+sx*4 Div 5,y+Sy*12 Div 20);
PlotLIne(x+sx*4 Div 5,y+Sy*12 Div 20,x+sx*4 Div 5,y+Sy*8 Div 20);
PlotLIne(x+sx*4 Div 5,y+Sy*8 Div 20,x+sx Div 5,y+Sy*8 Div 20);
PlotLIne(x+sx Div 5,y+Sy*8 Div 20,x+sx Div 5,y+Sy*12 Div 20);
End;
Procedure _8(x,y:Integer);
Begin
PlotLIne(x+Sx Div 2,y,x+Sx Div 2,y+Sy Div 5);
PlotLIne(x+Sx Div 2,y+Sy*4 Div 5,x+Sx Div 2,y+Sy);
PlotLIne(x+Sx*12 Div 20,y+Sy Div 5,x+Sx*12 Div 20,y+Sy*4 Div 5);
PlotLIne(x+Sx*12 Div 20,y+Sy*4 Div 5,x+Sx*8 Div 20,y+Sy*4 Div 5);
PlotLIne(x+Sx*8 Div 20,y+Sy*4 Div 5,x+Sx*8 Div 20,y+Sy Div 5);
PlotLIne(x+Sx*8 Div 20,y+Sy Div 5,x+Sx*12 Div 20,y+Sy Div 5);
End;
Procedure _0(x,y:Integer);
Begin
End;
Procedure _10(x,y:Integer);
Begin
PlotLIne(x+sx,y+sy Div 2,x+sx Div 2,y+sy Div 2);
PlotLIne(x+sx Div 2,y+sy Div 2,x+sx Div 2,y+sy);
End;
Procedure _11(x,y:Integer);
Begin
PlotLIne(x,y+sy Div 2,x+sx Div 2,y+sy Div 2);
PlotLIne(x+sx Div 2,y+sy Div 2,x+sx Div 2,y+sy);
End;
Procedure _12(x,y:Integer);
Begin
PlotLIne(x+sx Div 2,y,x+sx Div 2,y+sy Div 2);
PlotLIne(x+sx Div 2,y+sy Div 2,x+sx,y+sy Div 2);
End;
Procedure _13(x,y:Integer);
Begin
PlotLIne(x+sx Div 2,y,x+sx Div 2,y+sy Div 2);
PlotLIne(x+sx Div 2,y+sy Div 2,x,y+sy Div 2);
End;
Procedure _14(x,y:Integer);
Begin
PlotLIne (x,y+sy Div 2,x+sx,y+sy Div 2);
PlotLIne (x+sx Div 2,y,x+sx Div 2,y+sy);
FillCircle(x+sx Div 2,y+sy Div 2,2);
End;
Procedure _15(x,y:Integer);
Begin
PlotLIne (x+sx Div 2,y+sy Div 2,x+sx,y+sy Div 2);
PlotLIne (x+sx Div 2,y,x+sx Div 2,y+sy);
FillCircle(x+sx Div 2,y+sy Div 2,2);
End;
Procedure _16(x,y:Integer);
Begin
PlotLIne (x,y+sy Div 2,x+sx Div 2,y+sy Div 2);
PlotLIne (x+sx Div 2,y,x+sx Div 2,y+sy);
FillCircle(x+sx Div 2,y+sy Div 2,2);
End;
Procedure _17(x,y:Integer);
Begin
PlotLIne (x,y+sy Div 2,x+sx,y+sy Div 2);
PlotLIne (x+sx Div 2,y+sy Div 2,x+sx Div 2,y+sy);
FillCircle(x+sx Div 2,y+sy Div 2,2);
End;
Procedure _18(x,y:Integer);
Begin
PlotLIne (x,y+sy Div 2,x+sx,y+sy Div 2);
PlotLIne (x+sx Div 2,y,x+sx Div 2,y+sy Div 2);
FillCircle(x+sx Div 2,y+sy Div 2,2);
End;
Begin
If An=CurrentElement
Then
SetColOr(2)
Else
SetColOr(10);
FillRect(Ax,Ay,Sx,Sy);
SetColOr(4);
Case An Of
1:_1(Ax,Ay); 2:_2(Ax,Ay);3:_3(Ax,Ay);4:_4(Ax,Ay); 5:_5(Ax,Ay); 6:_6(Ax,Ay); 7:_7(Ax,Ay); 8:_8(Ax,Ay);
9:_9(Ax,Ay); 10:_10(Ax,Ay); 11:_11(Ax,Ay); 12:_12(Ax,Ay);
13:_13(Ax,Ay); 14:_14(Ax,Ay); 15:_15(Ax,Ay); 16:_16(Ax,Ay);
17:_17(Ax,Ay); 18:_18(Ax,Ay);
Else _0(Ax,Ay);
End;
End;
Begin
With Size Do
Begin
Sx:=x Div 3 - 2; Sy:=y Div 7 - 2;
End;
SetColOr(9);
FillRect(0,0,Size.X,(Sy+2)*6+CurrentFont^.Height+2);
SetColOr(4);
WriteStr((Size.X-14*CurrentFont^.Width) Div 2, 0, Меню элементов);
For i:=1 To 6 Do
For j:=1 To 3 Do
ElDraw((j-1)*(Sx+2),(i-1)*(Sy+2)+CurrentFont^.Height+2,(i-1)*3+j);
If CurrentElement=0
Then
SetColOr(2)
Else
SetColOr(10);
FillRect(0,(Sy+2)*6+CurrentFont^.Height+2,Size.X,Size.Y);
SetColOr(15);
WriteStr((Size.X-12*CurrentFont^.Width) Div 2,((Sy+2)*6+
CurrentFont^.Height Div 2 +2 + Size.Y) Div 2, Пустое место);
End;
Procedure TToolBar.HAndleEvent;
Var x,y:Integer;
Begin
Inherited HAndleEvent(Event);
If (Event.What=evMouseDown) And (Event.Buttons=mbLeftButton)
Then
Begin
x:=(Event.Where.X-CurrentFont^.Width-2) Div Sx;
y:=(Event.Where.Y-CurrentFont^.Height-2) Div Sy-1;
CurrentElement:=y*3+x+1;
Sy*7+CurrentFont^.Height+2"> If Event.Where.Y>Sy*7+CurrentFont^.Height+2
Then CurrentElement:=0;
DrawView;
ClearEvent(Event);
End;
End;
ConstructOr TShemeView.Init(Var R: TRect);
Begin
Inherited Init(R);
Font:=@Font8x8;
GrowMode:= GrowMode Or (gfGrowHiX+gfGrowHiY);
End;
Procedure TShemeView.Draw;
Const
Special:Integer=2;
Var
i,j: Integer;
c:Byte;
Procedure ElDraw(Ax,Ay:Integer; An,l:Byte);
Procedure _1(x,y:Integer);
Begin
plotlIne (x,y+Sy1 Div 2,x+Sx1,y+Sy1 Div 2);
End;
Procedure _2(x,y:Integer);
Begin
PlotLIne (x+Sx1 Div 2+Special,y,x+Sx1 Div 2+Special,y+Sy1);
End;
Procedure _9(x,y:Integer);
Begin
PlotLIne (x,y+Sy1 Div 2,x+Sx1,y+Sy1 Div 2);
PlotLIne (x+Sx1 Div 2+Special,y,x+Sx1 Div 2+Special,y+Sy1);
End;
{ Procedure _3(x,y:Integer);
Begin
PlotLIne (x,y+Sy1 Div 2,x+Sx1 Div 5+Special,y+Sy1 Div 2);
PlotLIne (x+Sx1*4 Div 5+Special,y+Sy1 Div 2,x+Sx1,y+Sy1 Div 2);
ThickCircle(x+Sx1 Div 2+Special,y+Sy1 Div 2,Sx1*2 Div 6,1);
PlotLIne (x+Sx1 Div 4+Special,y+Sy1 Div 2,x+Sx1*3 Div 4+Special,y+Sy1 Div 2);
PlotLIne (x+Sx1*3 Div 4+Special,y+Sy1 Div 2,x+Sx1 Div 2+Special,y+Sy1*12 Div 20);
PlotLIne (x+Sx1*3 Div 4+Special,y+Sy1 Div 2,x+Sx1 Div 2+Special,y+Sy1*8 Div 20);
End;
Procedure _4(x,y:Integer);
Begin
PlotLIne (x,y+Sy1 Div 2,x+Sx1 Div 5+Special,y+Sy1 Div 2);
PlotLIne (x+Sx1*4 Div 5+Special,y+Sy1 Div 2,x+Sx1,y+Sy1 Div 2);
ThickCircle(x+Sx1 Div 2+Special,y+Sy1 Div 2,Sx1*2 Div 6,1);
PlotLIne (x+Sx1 Div 4+Special,y+Sy1 Div 2,x+Sx1*3 Div 4+Special,y+Sy1 Div 2);
PlotLIne (x+Sx1 Div 4+Special,y+Sy1 Div 2,x+Sx1 Div 2+Special,y+Sy1*12 Div 20);
PlotLIne (x+Sx1 Div 4+Special,y+Sy1 Div 2,x+Sx1 Div 2+Special,y+Sy1*8 Div 20);
End;
Procedure _5(x,y:Integer);
Begin
PlotLIne (x+Sx1 Div 2+Special,y,x+Sx1 Div 2+Special,y+Sy1*3 Div 10);
PlotLIne (x+Sx1 Div 2+Special,y+Sy1*7 Div 10,x+Sx1 Div 2+Special,y+Sy1);
ThickCircle(x+Sx1 Div 2+Special,y+Sy1 Div 2,Sx1*2 Div 6,1);
PlotLIne (x+Sx1 Div 2+Special,y+Sy1*3 Div 8,x+Sx1 Div 2+Special,y+Sy1*5 Div 8);
PlotLIne (x+Sx1 Div 2+Special,y+Sy1*3 Div 8,x+Sx1*12 Div 20+Special,y+Sy1 Div 2);
PlotLIne (x+Sx1 Div 2+Special,y+Sy1*3 Div 8,x+Sx1*8 Div 20+Special,y+Sy1 Div 2);
End;
Procedure _6(x,y:Integer);
Begin
PlotLIne (x+Sx1 Div 2+Special,y,x+Sx1 Div 2+Special,y+Sy1*3 Div 10);
PlotLIne (x+Sx1 Div 2+Special,y+Sy1*7 Div 10,x+Sx1 Div 2+Special,y+Sy1);
ThickCircle(x+Sx1 Div 2+Special,y+Sy1 Div 2,Sx1*2 Div 6,1);
PlotLIne (x+Sx1 Div 2+Special,y+Sy1*3 Div 8,x+Sx1 Div 2+Special,y+Sy1*5 Div 8);
PlotLIne (x+Sx1 Div 2+Special,y+Sy1*5 Div 8,x+Sx1*12 Div 20+Special,y+Sy1 Div 2);
PlotLIne (x+Sx1 Div 2+Special,y+Sy1*5 Div 8,x+Sx1*8 Div 20+Special,y+Sy1 Div 2);
End;}
Procedure _3(x,y:Integer);
Begin
PlotLIne (x,y+Sy1 Div 2,x+Sx1*2 Div 5+Special,y+Sy1 Div 2);
PlotLIne (x+Sx1*3 Div 5+Special,y+Sy1 Div 2,x+Sx