Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F78919125
ComplexNumber.hpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Aug 23, 18:19
Size
1 KB
Mime Type
text/x-c++
Expires
Sun, Aug 25, 18:19 (2 d)
Engine
blob
Format
Raw Data
Handle
20122054
Attached To
R9360 PCSC_git
ComplexNumber.hpp
View Options
#ifndef COMPLEXNUMBERHEADERDEF
#define COMPLEXNUMBERHEADERDEF
#include <iostream>
class ComplexNumber {
private:
double mRealPart;
double mImaginaryPart;
public:
// Constructors
ComplexNumber();
ComplexNumber(double x, double y);
ComplexNumber(const ComplexNumber &c);
ComplexNumber(const double d);
// Get methods
double GetRealPart() const;
double GetImaginaryPart() const;
// Public methods
double CalculateModulus() const;
double CalculateArgument() const;
ComplexNumber CalculatePower(double n) const;
ComplexNumber CalculateConjugate() const;
void SetConjugate();
// Operators
ComplexNumber &operator=(const ComplexNumber &z);
ComplexNumber operator-() const;
ComplexNumber operator+(const ComplexNumber &z) const;
ComplexNumber operator-(const ComplexNumber &z) const;
ComplexNumber operator*(const double d) const;
ComplexNumber operator*(const ComplexNumber &z) const;
// Friend functions
friend std::ostream &operator<<(std::ostream &output, const ComplexNumber &z);
friend double RealPart(const ComplexNumber &z);
friend double ImaginaryPart(const ComplexNumber &z);
};
#endif
Event Timeline
Log In to Comment