Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- class complex
- {
- float x, y;
- public:
- complex(float x, float y);
- complex(float x) :complex(x, 0){}
- complex() :complex(0, 0){}
- complex(const complex &z) : complex(z.x, z.y) {}
- ~complex();
- float re(){ return this->x; }
- void setX(float x){ this->x = x; }
- float im(){ return this->y; }
- void setY(float y){ this->y = y; }
- float abs();
- complex* conjugate();
- complex* operator+(const complex&);
- complex* operator-(const complex&);
- complex* operator*(const complex&);
- complex* operator/(const complex&);
- complex* operator+(float);
- complex* operator-(float);
- complex* operator*(float);
- complex* operator/(float);
- complex* operator+=(const complex&);
- complex* operator-=(const complex&);
- complex* operator*=(const complex&);
- complex* operator/=(const complex&);
- complex* operator+=(float);
- complex* operator-=(float);
- complex* operator*=(float);
- complex* operator/=(float);
- complex* operator==(const complex&);
- complex* operator!=(const complex&);
- complex* reciprocal();
- complex* e();
- complex* sinus();
- complex* cosinus();
- complex* tangent();
- friend ostream& operator<<(ostream&, const complex&);
- friend istream& operator>>(istream&, complex&);
- };
Advertisement
Add Comment
Please, Sign In to add comment