📄 xuand.~pas
字号:
unit xuand;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, TeEngine, Series, Buttons, ExtCtrls, TeeProcs, Chart;
type
Txdfrm = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
Edit8: TEdit;
Edit9: TEdit;
Edit10: TEdit;
Edit11: TEdit;
Edit12: TEdit;
Edit13: TEdit;
Edit14: TEdit;
Edit15: TEdit;
Edit16: TEdit;
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
CheckBox3: TCheckBox;
CheckBox4: TCheckBox;
CheckBox5: TCheckBox;
CheckBox6: TCheckBox;
CheckBox7: TCheckBox;
CheckBox8: TCheckBox;
CheckBox9: TCheckBox;
CheckBox10: TCheckBox;
CheckBox11: TCheckBox;
CheckBox12: TCheckBox;
CheckBox13: TCheckBox;
CheckBox14: TCheckBox;
CheckBox15: TCheckBox;
CheckBox16: TCheckBox;
Edit17: TEdit;
Edit18: TEdit;
Edit19: TEdit;
Edit20: TEdit;
Edit21: TEdit;
Edit22: TEdit;
Edit23: TEdit;
Edit24: TEdit;
Edit25: TEdit;
Edit26: TEdit;
Edit27: TEdit;
Edit28: TEdit;
Edit29: TEdit;
Edit30: TEdit;
Edit31: TEdit;
Edit32: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
xdfrm: Txdfrm;
implementation
uses qzj;
{$R *.dfm}
var
Xk:array [1..16] of real;
Yk:array [1..16] of real;
C,K,B:double;
R:single;
procedure Txdfrm.Button1Click(Sender: TObject);
var
n,i:integer;
Xi,Xi2,Xyi,Yi:double;
Xp,Yp,P1,P2,P21,P22:double;
begin
Xi:=0;
Xi2:=0;
Xyi:=0;
Yi:=0;
Xp:=0;
Yp:=0;
P1:=0;
P2:=0;
P21:=0;
P22:=0;
qzjfrm.series1.Clear ;
if checkBox1.Checked then
begin
Xk[n]:= strtofloat(edit1.Text);
Yk[n]:= strtofloat(edit17.Text);
n:=n+1;
qzjfrm.series1.AddXY(strtofloat(edit17.Text),strtofloat(edit1.Text));
end;
if checkbox2.Checked then
begin
Xk[n]:= strtofloat(edit2.Text);
Yk[n]:= strtofloat(edit18.Text);
n:=n+1;
qzjfrm.series1.AddXY(strtofloat(edit18.Text),strtofloat(edit2.Text));
end;
if checkbox3.Checked then
begin
Xk[n]:= strtofloat(edit3.Text);
Yk[n]:= strtofloat(edit19.Text);
n:=n+1;
qzjfrm.series1.AddXY(strtofloat(edit19.Text),strtofloat(edit3.Text));
end;
if checkbox4.Checked then
begin
Xk[n]:= strtofloat(edit4.Text);
Yk[n]:= strtofloat(edit20.Text);
n:=n+1;
qzjfrm.series1.AddXY(strtofloat(edit20.Text),strtofloat(edit4.Text));
end;
if checkbox5.Checked then
begin
Xk[n]:= strtofloat(edit5.Text);
Yk[n]:= strtofloat(edit21.Text);
n:=n+1;
qzjfrm.series1.AddXY(strtofloat(edit21.Text),strtofloat(edit5.Text));
end;
if checkbox6.Checked then
begin
Xk[n]:= strtofloat(edit6.Text);
Yk[n]:= strtofloat(edit22.Text);
n:=n+1;
qzjfrm.series1.AddXY(strtofloat(edit22.Text),strtofloat(edit6.Text));
end;
if checkbox7.Checked then
begin
Xk[n]:= strtofloat(edit7.Text);
Yk[n]:= strtofloat(edit23.Text);
n:=n+1;
qzjfrm.series1.AddXY(strtofloat(edit7.Text),strtofloat(edit23.Text));
end;
if checkbox8.Checked then
begin
Xk[n]:= strtofloat(edit8.Text);
Yk[n]:= strtofloat(edit24.Text);
n:=n+1;
qzjfrm.series1.AddXY(strtofloat(edit8.Text),strtofloat(edit24.Text));
end;
if checkbox9.Checked then
begin
Xk[n]:= strtofloat(edit9.Text);
Yk[n]:= strtofloat(edit25.Text);
n:=n+1;
qzjfrm.series1.AddXY(strtofloat(edit9.Text),strtofloat(edit25.Text));
end;
if checkbox10.Checked then
begin
Xk[n]:= strtofloat(edit10.Text);
Yk[n]:= strtofloat(edit26.Text);
n:=n+1;
qzjfrm.series1.AddXY(strtofloat(edit10.Text),strtofloat(edit26.Text));
end;
if checkbox11.Checked then
begin
Xk[n]:= strtofloat(edit11.Text);
Yk[n]:= strtofloat(edit27.Text);
n:=n+1;
qzjfrm.series1.AddXY(strtofloat(edit11.Text),strtofloat(edit27.Text));
end;
if checkbox12.Checked then
begin
Xk[n]:= strtofloat(edit12.Text);
Yk[n]:= strtofloat(edit28.Text);
n:=n+1;
qzjfrm.series1.AddXY(strtofloat(edit12.Text),strtofloat(edit28.Text));
end;
if checkbox13.Checked then
begin
Xk[n]:= strtofloat(edit13.Text);
Yk[n]:= strtofloat(edit29.Text);
n:=n+1;
qzjfrm.series1.AddXY(strtofloat(edit13.Text),strtofloat(edit29.Text));
end;
if checkbox14.Checked then
begin
Xk[n]:= strtofloat(edit14.Text);
Yk[n]:= strtofloat(edit30.Text);
n:=n+1;
qzjfrm.series1.AddXY(strtofloat(edit14.Text),strtofloat(edit30.Text));
end;
if checkbox15.Checked then
begin
Xk[n]:= strtofloat(edit15.Text);
Yk[n]:= strtofloat(edit31.Text);
n:=n+1;
qzjfrm.series1.AddXY(strtofloat(edit15.Text),strtofloat(edit31.Text));
end;
if checkbox16.Checked then
begin
Xk[n]:= strtofloat(edit16.Text);
Yk[n]:= strtofloat(edit32.Text);
n:=n+1;
qzjfrm.series1.AddXY(strtofloat(edit16.Text),strtofloat(edit32.Text));
end;
for i:=0 to n-1 do
begin
Xi:=xi+Xk[i];
Xi2:=Xi2+Xk[i]*Xk[i];
Yi:=Yi+Yk[i];
Xyi:=Xyi+Xk[i]*yk[i];
end;
Xp:=Xi/n;
Yp:=Yi/n;
for i:=0 to n-1 do
begin
P1:=P1+(Xk[i]-Xp)*(Yk[i]-Yp);
P21:=P21+(Xk[i]-Xp)*(Xk[i]-Xp);
P22:=P22+(Yk[i]-Yp)*(Yk[i]-Yp);
end;
B:= P1/P22;
C:=Xp-B*Yp;
P2:=sqrt(P21*p22);
R:=p1/P2;
case qzjfrm.ComboBox2.ItemIndex of
0:
begin
qzjfrm.Edit12.Text := formatfloat('0.0000000000',Xp);
qzjfrm.edit16.Text :=formatfloat('0.0000000000',C);
qzjfrm.edit17.Text :=formatfloat('0.00000',R);
end;
1:
begin
qzjfrm.Edit12.Text := formatfloat('0.0000000000',Xp);
end;
end;
end;
procedure Txdfrm.FormCreate(Sender: TObject);
begin
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -