📄 unit1_compl.h
字号:
//---------------------------------------------------------------------------
#ifndef Unit1_complH
#define Unit1_complH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Menus.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TLabel *LabelA;
TLabel *LabelB;
TLabel *LabelC;
TLabel *LabelD;
TLabel *LabelE;
TLabel *LabelF;
TLabel *LabelG;
TLabel *LabelH;
TLabel *LabelI;
TLabel *LabelJ;
TLabel *LabelReal;
TLabel *LabelImage;
TEdit *A_re;
TEdit *B_re;
TEdit *C_re;
TEdit *D_re;
TEdit *E_re;
TEdit *A_im;
TEdit *B_im;
TEdit *C_im;
TEdit *D_im;
TEdit *E_im;
TEdit *F_im;
TEdit *G_im;
TEdit *H_im;
TEdit *I_im;
TEdit *J_im;
TEdit *J_re;
TEdit *I_re;
TEdit *H_re;
TEdit *G_re;
TEdit *F_re;
TEdit *Expression;
TLabel *Result;
TLabel *LabelResult;
TButton *ButtonOK;
TLabel *ValueA;
TLabel *ValueC;
TLabel *ValueD;
TLabel *ValueE;
TLabel *ValueF;
TLabel *ValueG;
TLabel *ValueH;
TLabel *ValueI;
TLabel *ValueJ;
TLabel *ValueB;
TLabel *LabelClew;
TLabel *LabelExp;
TLabel *LabelVa;
void __fastcall A_reChange(TObject *Sender);
void __fastcall A_imChange(TObject *Sender);
void __fastcall B_reChange(TObject *Sender);
void __fastcall B_imChange(TObject *Sender);
void __fastcall C_reChange(TObject *Sender);
void __fastcall C_imChange(TObject *Sender);
void __fastcall D_reChange(TObject *Sender);
void __fastcall D_imChange(TObject *Sender);
void __fastcall E_reChange(TObject *Sender);
void __fastcall E_imChange(TObject *Sender);
void __fastcall F_reChange(TObject *Sender);
void __fastcall F_imChange(TObject *Sender);
void __fastcall G_reChange(TObject *Sender);
void __fastcall G_imChange(TObject *Sender);
void __fastcall H_reChange(TObject *Sender);
void __fastcall H_imChange(TObject *Sender);
void __fastcall I_reChange(TObject *Sender);
void __fastcall I_imChange(TObject *Sender);
void __fastcall J_reChange(TObject *Sender);
void __fastcall J_imChange(TObject *Sender);
void __fastcall ButtonOKClick(TObject *Sender);
void __fastcall ExpressionChange(TObject *Sender);
// void __fastcall ExpressionChange(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
class cplex
{
public:
cplex(double=0.0,double=0.0);
friend cplex operator+(const cplex &,const cplex &);
friend cplex operator-(const cplex &,const cplex &);
friend cplex operator*(const cplex &,const cplex &);
friend cplex operator/(const cplex &,const cplex &);
//~cplex();
double real,imag;
};
//---------------------------------------------------------------------------
cplex::cplex(double real,double imag)
{
this->real=real;
this->imag=imag;
}
cplex operator+(const cplex &z1,const cplex &z2)
{
return cplex(z1.real+z2.real,z1.imag+z2.imag);
}
cplex operator-(const cplex &z1,const cplex &z2)
{
return cplex(z1.real-z2.real,z1.imag-z2.imag);
}
cplex operator*(const cplex &z1,const cplex &z2)
{
return cplex(z1.real*z2.real-z1.imag*z2.imag,
z1.real*z2.imag+z1.imag*z2.real);
}
cplex operator/(const cplex &z1,const cplex &z2)
{
double delta=z2.real*z2.real+z2.imag*z2.imag;
return cplex((z1.real*z2.real+z1.imag*z2.imag)/delta,
(-z1.real*z2.imag+z1.imag*z2.real)/delta);
}
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -