unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    PageControl1: TPageControl;
    TabSheet1: TTabSheet;
    TabSheet2: TTabSheet;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Edit3: TEdit;
    Edit4: TEdit;
    Edit5: TEdit;
    Button1: TButton;
    Image1: TImage;
    Edit6: TEdit;
    Edit7: TEdit;
    Edit8: TEdit;
    Edit9: TEdit;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    TabSheet3: TTabSheet;
    Chart1: TChart;
    Series1: TLineSeries;
    Button2: TButton;
    Series2: TPointSeries;
    Button3: TButton;
    Edit10: TEdit;
    Label10: TLabel;
    Label11: TLabel;
    Edit11: TEdit;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  A,B,C,y,x,x1,y1,x2,y2,xo,yo,y3,y4,x5,y5,h: extended;
  xmax,ymax:integer;
  xomin, xomax, yomin, yomax,hx,hy : extended;
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
A:=Strtofloat(Edit1.Text);
B:=Strtofloat(Edit2.Text);
C:=Strtofloat(Edit3.Text);
x1:=StrTofloat(Edit4.Text);
y1:=StrTofloat(Edit5.Text);
xomax:=StrToFloat(Edit6.Text);
xomin:=StrToFloat(Edit7.Text);
yomax:=StrToFloat(Edit8.Text);
yomin:=StrToFloat(Edit9.Text);
xmax:=Image1.Width;    // Чтение максимальной координаты по x
ymax:=Image1.Height;   // Чтение максимальной координаты по y
yo:=ymax/2;
xo:=xmax/2;

x:=(y1*B*A-C*A+B*x1)/((A*A+B));
y:=(-C-(A*x))/B;
x2:=2*x-x1;
y2:=2*y-y1;
y3:=(-A*(-100)-C)/B;
y4:=(-A*(100)-C)/B;
with Image1.Canvas do begin

Pen.Color:=clred;
Pen.Width:=1;
Rectangle (0, 0, xmax, ymax);
MoveTo(0,round(yo));         LineTo(xmax,round(yo));
   MoveTo(round(xo),0);           LineTo(round(xo),ymax);
Pen.Color:=clblack;
Pen.Width:=6;
Moveto(Round(x1+xo),Round(-y1+yo));
lineto(Round(x1+xo),Round(-y1+yo));
Pen.Color:=clblue;
Pen.Width:=6;
moveto(Round(x2+xo),Round(-y2+yo));
lineto(Round(x2+xo),Round(-y2+yo));
Pen.Color:=clgreen;
Pen.Width:=1;
MoveTo(round(-100+xo),round(-y3+yo));         LineTo(round(100+xo),round(-y4+yo));

end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
with Chart1 do begin
      LeftAxis.Automatic:=False;
      LeftAxis.Minimum:=yomin;
      LeftAxis.Maximum:=yomax;
      BottomAxis.Automatic:=False;
      BottomAxis.Minimum:=xomin;
      BottomAxis.Maximum:=xomax;
        Series1.Clear;
        Series1.AddXY(Round(-100),Round(y3));
        Series1.AddXY(Round(100),Round(y4));
        Series2.AddXY(Round(x1),Round(y1));
        Series2.AddXY(Round(x2),Round(y2));
                         end;


end;

procedure TForm1.Button3Click(Sender: TObject);
begin
Series1.Clear;
Series2.Clear;
x5:=Strtofloat(Edit10.Text);
h:=Strtofloat(Edit11.Text);
repeat
y5:=power(9,x5);
x5:=x5+h;
Series1.AddXY(Round(x5),Round(y5));
until y5>100
end;

end.
