unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, TeeProcs, TeEngine, Chart, StdCtrls, ComCtrls, Series, Clipbrd;

type
  TForm1 = class(TForm)
    PageControl1: TPageControl;
    TabSheet3: TTabSheet;
    Label10: TLabel;
    Label11: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    Label15: TLabel;
    Button3: TButton;
    Button4: TButton;
    Edit9: TEdit;
    Edit10: TEdit;
    Edit11: TEdit;
    Chart1: TChart;
    Series1: TLineSeries;

    procedure FormCreate(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  Form1: TForm1;
  m,i: integer;
  h,xn,xk,x,y:extended;

implementation
{$R *.dfm}

Function f(x: extended):extended;
 begin
  Result:=(1-(sqr(x)))*cos(x)-((x/2)*sin(x));
 end;


procedure TForm1.FormCreate(Sender: TObject);
begin

 Edit9.Text:='-10'; Edit10.Text:='10'; Edit11.Text:='1000';

 end;




procedure TForm1.Button3Click(Sender: TObject);
begin
xn:=StrToFloat(Edit9.Text);
  xk:=StrToFloat(Edit10.Text);
  m:=StrToInt(Edit11.Text);

         {Установка осей}
    with Chart1 do begin
      LeftAxis.Automatic:=True;

      BottomAxis.Automatic:=True;

        SeriesList[0].Clear;
      h:=(xk-xn)/(m-1);     x:=xn;
  for i:=1 to m do begin
      y:=f(x);
        SeriesList[0].AddXY(x,y);
      x:=x+h;
                         end;
                    end;

end;

procedure TForm1.Button4Click(Sender: TObject);
begin
Chart1.CopyToClipboardMetafile(True);
end;



end.


