complex - Online Linux Manual PageSection : 7
Updated : 2022-10-30
Source : Linux man-pages 6.03
NAMEcomplex − basics of complex mathematics
SYNOPSIS#include <complex.h>
DESCRIPTIONComplex numbers are numbers of the form z = a+b*i, where a and b are real numbers and i = sqrt(−1), so that i*i = −1. There are other ways to represent that number. The pair (a,b) of real numbers may be viewed as a point in the plane, given by X- and Y-coordinates. This same point may also be described by giving the pair of real numbers (r,phi), where r is the distance to the origin O, and phi the angle between the X-axis and the line Oz. Now z = r*exp(i*phi) = r*(cos(phi)+i*sin(phi)). The basic operations are defined on z = a+b*i and w = c+d*i as: addition: z+w = (a+c) + (b+d)*i multiplication: z*w = (a*c − b*d) + (a*d + b*c)*i division: z/w = ((a*c + b*d)/(c*c + d*d)) + ((b*c − a*d)/(c*c + d*d))*i Nearly all math function have a complex counterpart but there are some complex-only functions.
EXAMPLESYour C-compiler can work with complex numbers if it supports the C99 standard. Link with −lm. The imaginary unit is represented by I. /* check that exp(i * pi) == −1 */
#include <math.h> /* for atan */
#include <stdio.h>
#include <complex.h>
int
main(void)
{
double pi = 4 * atan(1.0);
double complex z = cexp(I * pi);
printf("%f + %f * i\n", creal(z), cimag(z));
}
SEE ALSOcabs(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) 0
Johanes Gumabo
Data Size : 9,349 byte
man-complex.5Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 2 / 198,230
Visitor ID : :
Visitor IP : 3.149.244.92 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.