unit Unit3;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, TeEngine, Series, TeeProcs, Chart;

type
  TForm3 = class(TForm)
    Chart1: TChart;
    Series1: TLineSeries;
    Series2: TLineSeries;
    Panel1: TPanel;
    imgKONIEC: TImage;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure imgKONIECClick(Sender: TObject);

  private

  public

  end;

var
  Form3: TForm3;

implementation
{$R *.dfm}
{------------------------------------------------------------------------------}
procedure TForm3.FormDestroy(Sender: TObject);
begin
	Form3 := Nil;
end;

procedure TForm3.imgKONIECClick(Sender: TObject);
begin
	Close();
end;

procedure TForm3.FormClose(Sender: TObject; var Action: TCloseAction);
begin
	Action := caFree;

	Series1.SetFunction(Nil);
   Series2.SetFunction(Nil);
end;

procedure TForm3.FormCreate(Sender: TObject);
var
	lp : Integer;

begin
	for lp := 0 to 360-1 do
	begin
   	// co 30 stopni
      if (lp mod 30) = 0 then
   	begin
      	Series1.AddXY(lp, sin(lp * (PI / 180)));
         Series2.AddXY(lp, cos(lp * (PI / 180)));
      end;
   end;
end;

end.

