Леонид Неповинных
Леонид Неповинных

График в делфи, в Tchart

Мне надо построить график в Tchart, график строю но он получается корявый (он должен быть плавным, а у меня он резкий слишком) выкладываю код, кто сможет помогите
procedure TForm4.btn1Click(Sender: TObject);
begin
w:=form1.w;
d:=Form1.d;
f:=Form1.f;
k:=Form1.k;
xx:=-11;
while xx<=5 do
begin
xx:= xx+0.2;
prem:= Exp(-(d*xx/2/f));
mmo6.Lines.add(FloatToStr(prem));
mmo8.Lines.add(FloatToStr(xx));
yy:= -7;
while yy<=7 do
begin
yy:=yy+0.05;
mmo1.Lines.add(FloatToStr(yy));
ir:= Sqrt(xx*xx+yy*yy);
mmo2.Lines.add(FloatToStr(ir));
kof:=ir*sqrt(Sqr(d/2/f)+k/f);
mmo3.Lines.add(FloatToStr(kof));
try
x := kof;
Assert(x >= 0);
mmo4.Lines.add(FormatFloat('#0.0##############', BesselModified2ndKind(0, x)));
except
ShowMessage('Недопустимый аргумент !');
end;
pip:=w*prem*BesselModified2ndKind(0, x);
mmo5.lines.Add(FloatToStr(pip));
if pip<700 then if pip>550 then if xx>=0 then if yy>=0 then if yy<=1 then
begin
mmo7.lines.Add(FloatToStr(yy));
edt1.text:=FloatToStr(yy);
edt2.Text:=FloatToStr(pip);
cht1.Series[0].AddXY(yy,xx,'',clRed);
end;
if pip<650 then if pip>590 then if xx>=0.5 then if yy>=0.5 then
begin
cht1.Series[1].AddXY(yy,xx,'',clRed);
end;
if pip<650 then if pip>590 then if xx>=-0.5 then if xx<=1 then if yy>=0 then
begin
cht1.Series[2].AddXY(yy,xx,'',clRed);
end;
if pip<650 then if pip>590 then if xx<=0 then if xx>=-1.5 then if yy>=0 then
begin
cht1.Series[3].AddXY(yy,xx,'',clRed);
end;
if pip<650 then if pip>590 then if xx<=-1 then if yy>=1 then
begin
cht1.Series[4].AddXY(yy,xx,'',clRed);
end;
if pip<650 then if pip>590 then if xx<=0 then if yy>=0 then if yy<=1 then
begin
cht1.Series[5].AddXY(yy,xx,'',clRed);
end;
if pip<650 then if pip>590 then if xx<=0 then if yy<=0 then if yy>=-1 then
begin
cht1.Series[6].AddXY(yy,xx,'',clRed);
end;
if pip<650 then if pip>590 then if xx<=-1 then if yy<=-1 then
begin
cht1.Series[7].AddXY(yy,xx,'',clRed);
end;
if pip<650 then if pip>590 then if xx<=0 then if xx>=-1.5 then if yy<=0 then
begin
cht1.Series[8].AddXY(yy,xx,'',clRed);
end;
if pip<650 then if pip>590 then if xx>=-0.5 then if xx<=1 then if yy<=0 then
begin
cht1.Series[9].AddXY(yy,xx,'',clRed);
end;
if pip<650 then if pip>590 then if xx>=0.5 then if yy<=-0.5 then
begin
cht1.Series[10].AddXY(yy,xx,'',clRed);
end;
if pip<700 then if pip>550 then if xx>=0 then if yy<=0 then if yy>=-1 then
begin
cht1.Series[11].AddXY(yy,xx,'',clRed);
end;
if pip<610 then if pip>550 then
begin
mmo9.lines.add('temp='+floattostrf(pip,fffixed,3,1)+'; x='+FloatToStr(xx)+'; y='+floattostr(yy)+'; K0='+floattostr(BesselModified2ndKind(0, x)));
end;
end;

end;
yy:=0;
while yy<=5 do
begin
yy:=yy+0.05;
xx:= -5;
while xx<=0 do
begin
xx:=xx+0.05;
prem:= Exp(-(d*xx/2/f));
ir:= Sqrt(xx*xx+yy*yy);
kof:=ir*sqrt(Sqr(d/2/f)+k/f);
try
x := kof;
Assert(x >= 0);
mmo4.Lines.add(FormatFloat('#0.0##############', BesselModified2ndKind(0, x)));
except
ShowMessage('Недопустимый аргумент !');
end;
pip:=w*prem*BesselModified2ndKind(0, x);
if pip<610 then if pip>595 then

edt3.Text:=FloatToStr(yy);

end;

end;

end;

Светлана
Светлана

Это не код, а атомный песец какой-то. Удивительно что он вообще работает.
Хочешь плавный график - забей на Tchart и рисуй сам, сплайнами, желательно - бикубическими.

NA
Natalia Alexandrovna

Сериес должен состоят не из 10 точек, а примерно из 100-600 для плавности вывода

Похожие вопросы
Программирование Делфи
Как считать в делфи?
как построить график функции на делфи. как построить график функции y=a*sinx+b на промежутке (-pi;pi)
помогите в делфи !!!:??
Делфи чудит или как?
как компилировать в делфи если...
процедура FormCloseQuery делфи. процедура FormCloseQuery делфи для чего нужна?
Помогите по делфи
Помогите с делфи
делфи. в чем ошибка?