Страница 1 из 1

перевести в C#

Добавлено: 01 апр 2011, 01:02
~Леди~
Помогите перевести в C#

Код: Выделить всё

 var t,p,a,tn,tk:real;
    e,k:integer;
    h,sw:array [0..1000] of real;

  procedure graphic;
label 10;
var yy,tt,s,dt,ttt:real;
    i:integer;
begin
tt:=tn;
dt:=t/30;
Form1.Chart1.Series[0].Clear;
Form1.Chart1.Series[1].Clear;
Form1.Chart1.Series[2].Clear;
Form1.Chart1.Series[3].Clear;
Form1.Chart2.Series[0].Clear;
Form1.Chart2.Series[1].Clear;
Form1.Chart2.Series[2].Clear;
Form1.Chart3.Series[0].Clear;
while tt<tk do
begin
s:=0;
for i:=0 to k do
begin
if i>0 then h[i]:=2*a*sin(i*pi*t/p)/(i*pi)
else
begin
h[i]:=a*t/p;
goto 10;
end;
s:=s+h[i]*cos(2*i*pi*tt/p);
10: Form1.Chart1.Series[2].AddXY(i/p,abs(h[i]),' ',Clblack);
Form1.Chart1.Series[1].AddXY(i/p,abs(h[i]),' ',Clblack);
if i=0 then sw[i]:=h[i]*2
else
sw[i]:=2*a*sin(i*pi*t/p)/(i*pi);
end;
Form1.Chart2.Series[0].AddXY(tt,s+a*t/(p),' ',Clred);
Form1.Chart2.Series[1].AddXY(tt,h[1]*cos(2*pi*tt/p),' ',Clred);
Form1.Chart2.Series[2].AddXY(tt,h[3]*cos(3*2*pi*tt/p),' ',Clred);
tt:=tt+dt;
end;
for i:=0 to k do
  begin
    ttt:=i*p;
    while ttt<(i+1)*p do
      begin
        if ((ttt>=i*p) and (ttt<=i*p+t)) then
             yy:=a
           else yy:=0;
         Form1.Chart3.Series[0].AddXY(ttt-t/2,yy,' ',clblue);
         ttt:=ttt+dt;
       end;
   end;
end;
end;

Заранее спасибо!!!

Re: перевести в C#

Добавлено: 07 апр 2011, 11:27
Romeo
Что именно не получается?