Advertisement
wojtas626

[C] Zmiana postaci liczby zespolonej

Dec 4th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. double reAndIm(double z, double fi, double *b)
  6. {
  7.     *b = z * sin(fi);
  8.  
  9.     return (z * cos(fi));
  10. }
  11.  
  12. int main()
  13. {
  14.     double z, fi, a, b;
  15.  
  16.     printf("Podaj |z|:\n");
  17.     scanf("%lf", &z);
  18.  
  19.     printf("Podaj fi:\n");
  20.     scanf("%lf", &fi);
  21.  
  22.     a = reAndIm(z, fi, &b);
  23.  
  24.     printf("z = %lf + %lfi\n", a, b);
  25.     printf("z = %lf * e^i*%lf", z, fi);
  26.  
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement