Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. #ifndef FUNCTIONS_H
  2. #define FUNCTIONS_H
  3. #define PI 3.14
  4. #define INFINITE 1.5;
  5. #include <math.h>
  6. #include <functioncalculater.h>
  7. #include <QtCore/QString>
  8. #include <QtCore/QDebug>
  9.  
  10. using namespace std;
  11.  
  12. namespace functions2
  13. {
  14. double T=INFINITE;
  15. double w=(2*PI)/T;
  16.  
  17. double function0(double x)
  18. {
  19. return (x==-1.0)?(0):(1);
  20. }
  21. }
  22.  
  23. namespace basicfunction
  24. {
  25.  
  26. double x=0;
  27.  
  28. double T;
  29. double w;
  30.  
  31. double (*function0)(double);
  32.  
  33. double calculateFImage( double _x )
  34. {
  35. std::complex<double> cnumber(0, -1);
  36. cnumber/=_x;
  37.  
  38. return std::abs(cnumber);
  39. }
  40.  
  41. complex<double> subintegratedReverseImage(complex<double> _z)
  42. {
  43. double z = real(_z);
  44. return complex<double>(0, -1.0/z) * exp( complex<double>(0, 1.0*(x)* z) );
  45. }
  46.  
  47. comp calculateFReverseImage(double _x)
  48. {
  49. x = _x;
  50. comp from = comp(0, 0);
  51. comp to = comp(3*w, 0);
  52.  
  53. comp cr = ( FunctionCalculater::cintegrate ( subintegratedReverseImage,
  54. from,
  55. to) );
  56. cr /= 1/2*PI;
  57. return cr;
  58. }
  59.  
  60.  
  61.  
  62. };
  63.  
  64. #endif // FUNCTIONS_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement