#include <stdio.h>

#include <math.h>


struct complex

{

double real;

double imaginary;

};

struct magphase

{

double magnitude;

double phase;

};

void F_magphase(struct complex *plex, struct magphase *mag);


void main()

{

struct complex p;

struct magphase q;


printf("구하고자 하는 복소수의 a+bj의  a 와 b를 적으시오 : ");

scanf("%lf %lf", &p.real, &p.imaginary);


F_magphase(&p, &q);


printf("%lf %lf ---> %lf %lf", p.real, p.imaginary, q.magnitude, q.phase);


}


void F_magphase(struct complex *plex, struct magphase *mag)

{

mag->magnitude = sqrt((plex->real)(plex->real) + (plex->imaginary)(plex->imaginary));

mag->phase = atan2(plex->imaginary / plex->real);


}







복소수의 위상이랑 절대값을 구하는 프로그램인데 뭐가 잘못된건지...ㅠㅠ