Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #include <complex.h>
- int main(int argc, const char * argv[]) {
- // Z = e^pi/4 (R * cos(11Pi/6 + 2pPI) + isin(RPi)/6)
- double pi = M_PI;
- double e = M_E;
- double Z = pow(e, pi/4);
- double R;
- scanf("%lf", &R);
- double p;
- scanf("%lf", &p);
- double tmp = 11 * pi / 6;
- tmp += 2 * p * pi;
- double i = CMPLX(0, 1);
- R *= (cos(tmp) + i * sin(R*pi/6));
- printf("Z = %.2lf + %.2lfi\n", creal(R), cimag(R));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement