dermai0r

Complex.h

Jun 20th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #pragma once
  2. #include <math.h>
  3. #include <iostream>
  4.  
  5.  
  6.  
  7. class Complex
  8. {
  9.  
  10. private:
  11. double _real = 0;
  12. double _img = 0;
  13.  
  14. public:
  15. Complex(double lfReal, double lfImg);
  16. Complex(const Complex& c);
  17. void print();
  18. Complex operator+ (const Complex& c)
  19. {
  20. Complex tmp(0, 0);
  21. tmp.setReal(_real + c._real);
  22. tmp.setImg(_img + c._img);
  23. printf("HERE: \n");
  24. tmp.print();
  25. return tmp;
  26. }
  27.  
  28. public:
  29. double getReal();
  30. double getImg();
  31. double getAbsValue();
  32. double getAngle();
  33.  
  34. public:
  35. void setReal(double lfReal);
  36. void setImg(double lfImg);
  37.  
  38. public:
  39. //std::string _calcOperator;
  40.  
  41. };
Add Comment
Please, Sign In to add comment