?? complex.h
字號:
// Complex.h: interface for the CComplex class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_COMPLEX_H__774B1FF0_7414_490F_AB45_53B7AD4EF228__INCLUDED_)
#define AFX_COMPLEX_H__774B1FF0_7414_490F_AB45_53B7AD4EF228__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define PI 3.14159265358979323846
class CComplex
{
public:
CComplex(const double & Real = 0, const double & Imag = 0):
Re(Real), Im(Imag) {}
CComplex(const CComplex & Rhs):
Re(Rhs.Re), Im(Rhs.Im) {}
~CComplex() {}
const CComplex & operator=(const CComplex & Rhs);
const CComplex & operator=(const double & Rhs);
const CComplex & operator+=(const CComplex & Rhs);
const CComplex & operator+=(const double & Rhs);
const CComplex & operator-=(const CComplex & Rhs);
const CComplex & operator-=(const double & Rhs);
const CComplex & operator*=(const CComplex & Rhs);
const CComplex & operator*=(const double & Rhs);
const CComplex & operator/=(const CComplex & Rhs);
const CComplex & operator/=(const double & Rhs);
CComplex operator+(const CComplex & Rhs) const;
CComplex operator+(const double & Rhs) const;
CComplex operator-(const CComplex & Rhs) const;
CComplex operator-(const double & Rhs) const;
CComplex operator*(const CComplex & Rhs) const;
CComplex operator*(const double & Rhs) const;
CComplex operator/(const CComplex & Rhs) const;
CComplex operator/(const double & Rhs) const;
bool operator!=(const CComplex & Rhs) const;
bool operator!=(const double & Rhs) const;
bool operator==(const CComplex & Rhs) const;
bool operator==(const double & Rhs) const;
CComplex operator-() const;
double GetReal() {return Re;}
void SetReal(double Real) {Re = Real;}
double GetImag() {return Im;}
void SetImag(double Imag) {Im = Imag;}
const CComplex & Rotate(double angle);
const CComplex & Normalize();
double GetAbs();
double GetComplexAngle();
private:
double Re;
double Im;
};
#endif // !defined(AFX_COMPLEX_H__774B1FF0_7414_490F_AB45_53B7AD4EF228__INCLUDED_)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -