Advertisement
Josif_tepe

Untitled

Mar 23rd, 2021
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <complex.h>
  4.  
  5. int main(int argc, const char * argv[]) {
  6.    // Z = e^pi/4 (R * cos(11Pi/6 + 2pPI) + isin(RPi)/6)
  7.    
  8.     double pi = M_PI;
  9.     double e = M_E;
  10.     double Z = pow(e, pi/4);
  11.     double R;
  12.     scanf("%lf", &R);
  13.     double p;
  14.     scanf("%lf", &p);
  15.     double tmp = 11 * pi / 6;
  16.     tmp += 2 * p * pi;
  17.     double i = CMPLX(0, 1);
  18.     R *= (cos(tmp) + i * sin(R*pi/6));
  19.     printf("Z = %.2lf + %.2lfi\n", creal(R), cimag(R));
  20.    
  21.    
  22.     return 0;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement