OneLexus
New member
PHP:
type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Button1: TButton;
Label4: TLabel;
Label5: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Label6: TLabel;
NE: TEdit;
ANE: TRzNumericEdit;
BNE: TRzNumericEdit;
Chart1: TChart;
Series1: TLineSeries;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
DX,Xi,A,B,X,X1,X2:double;
N:integer;
Y: array of double;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var i:integer;
begin
A:=ANE.Value;
B:=BNE.Value;
N:=StrToInt(NE.text);
X2:=StrToFloat(Edit2.text);
X1:=StrToFloat(Edit1.text);
SetLength(Y,N);
DX:=X2-X1;
DX:=DX/N;
Xi:=X1;
Chart1.Series[0].Active:=true;
Chart1.Series[0].Clear;
for i:=0 to N-1 do
begin
Xi:=Xi+DX;
Y[i]:=A*cos(Xi)+B*sin(Xi);
Chart1.Series[0].AddY(Y[i],FloatToStr(Xi));//Çíà÷åíèé
end;
end;