Здравствуйте, уже обращался всем знакомым,но никто не может помочь. Собственно сам код ниже. Точки разрыва, это -9 и 9, -20 и 20. При значениях равной или меньше -7 и 7 график строиться по чётко.
Собственно вам само условие.
unit Unit3;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Grids, Vcl.StdCtrls, Vcl.Menus, Math;
type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
Label1: TLabel;
StringGrid1: TStringGrid;
Label2: TLabel;
Label3: TLabel;
procedure N1Click(Sender: TObject);
procedure N2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
x:array[1..12] of real;
i,p,cout:integer;
a,g,y1,y2,z,d,y3,s,k,n:real;
sg:double;
implementation
{$R *.dfm}
procedure TForm1.N1Click(Sender: TObject);
begin
begin
x[1]:=1;
StringGrid1.Cells[0,0]:=formatfloat('0.00',x[1]);
z:=x[1];
y1:=0;
y2:=0;
for i := 1 to 12 do begin
z:=1*Power(exp(ln(10)/6),i);
//sg:=exp(ln(z)/12);
StringGrid1.Cells[i,0]:=formatfloat('0.00',z);
y1:=y1+z;
y2:=y2+(1/z);
end;
y1:=y1+x[1];
y2:=y2+x[1];
a:=y1/12;
//sg:=y1/12;
for i:=1 to 12 do begin
z:=1*Power(exp(ln(10)/6),i);
sg:=z/12;
//sg:=(1*(Power(exp(ln(10)/6),i)-1))/(exp(ln(10)/6)-1);
if s<0 then
k:=-power(abs(z),1/12)
else begin
k:=power(s,z/12);
end;
end;
Label2.Caption:='Ñðåäíåå àðèôìèòè÷åñêîå ðàâíî '+formatfloat('0.000',a);
Label3.Caption:='Ñðåäíåå ãåîìåòðè÷åñêîå ðàâíî '+formatfloat('0.000',k);
end;
end;
procedure TForm1.N2Click(Sender: TObject);
begin
close();
end;
end.