complex(7) Miscellaneous Information Manual complex(7) complex - Math library (libm, -lm) #include -- z = a+b*i, a b , i = sqrt(-1), i*i = -1. . (a,b) , X Y. (r,phi), r -- 0, phi -- X 0z. , z = r*exp(i*phi) = r*(cos(phi)+i*sin(phi)). , z = a+b*i w = c+d*i, : : z+w = (a+c) + (b+d)*i : z*w = (a*c - b*d) + (a*d + b*c)*i : z/w = ((a*c + b*d)/(c*c + d*d)) + ((b*c - a*d)/(c*c + d*d))*i , . Your C-compiler can work with complex numbers if it supports the C99 standard. The imaginary unit is represented by I. /* check that exp(i * pi) == -1 */ #include /* for atan */ #include #include int main(void) { double pi = 4 * atan(1.0); double complex z = cexp(I * pi); printf("%f + %f * i\n", creal(z), cimag(z)); } cabs(3), cacos(3), cacosh(3), carg(3), casin(3), casinh(3), catan(3), catanh(3), ccos(3), ccosh(3), cerf(3), cexp(3), cexp2(3), cimag(3), clog(3), clog10(3), clog2(3), conj(3), cpow(3), cproj(3), creal(3), csin(3), csinh(3), csqrt(3), ctan(3), ctanh(3) () Azamat Hackimov , Dmitriy S. Seregin , Dmitry Bolkhovskikh , Katrin Kutepova , Yuri Kozlov ; GNU (GNU General Public License - GPL, 3 ) , - . - , , () () () <>. Linux 6.9.1 15 2024 . complex(7)