C Programming/complex.h/Function reference
cacos
[edit | edit source ]Prototype
[edit | edit source ]doublecomplexcacos(doublecomplexz); floatcomplexcacosf(floatcomplexz); longdoublecomplexcacosl(longdoublecomplexz);
Description
[edit | edit source ]These functions compute and return the complex arc cosine value, in the range of a strip mathematically unbounded along the imaginary axis and in the interval [0, π] along the real axis.
casin
[edit | edit source ]Prototype
[edit | edit source ]doublecomplexcasin(doublecomplexz); floatcomplexcasinf(floatcomplexz); longdoublecomplexcasinl(longdoublecomplexz);
Description
[edit | edit source ]These functions compute and return the complex arc sine value, in the range of a strip mathematically unbounded along the imaginary axis and in the interval [-π/2, +π/2] along the real axis.
catan
[edit | edit source ]Prototype
[edit | edit source ]doublecomplexcatan(doublecomplexz); floatcomplexcatanf(floatcomplexz); longdoublecomplexcatanl(longdoublecomplexz);
Description
[edit | edit source ]These functions compute and return the complex arc tangent value, in the range of a strip mathematically unbounded along the imaginary axis and in the interval [-π/2, +π/2] along the real axis.
ccos
[edit | edit source ]Prototype
[edit | edit source ]doublecomplexccos(doublecomplexz); floatcomplexccosf(floatcomplexz); longdoublecomplexccosl(longdoublecomplexz);
Description
[edit | edit source ]The C library provides with the ccos
function which gives the cosine of a complex number.It is included in the header file complex.h. This function returns a double-precision floating point number.
The ccos function can be expressed as:
ccosz = (exp (i * z) + exp (-i * z))/2[1]
csin
[edit | edit source ]Prototype
[edit | edit source ]doublecomplexcsin(doublecomplexz); floatcomplexcsinf(floatcomplexz); longdoublecomplexcsinl(longdoublecomplexz);
Description
[edit | edit source ]These functions compute and return the complex sine value.
ctan
[edit | edit source ]Prototype
[edit | edit source ]doublecomplexctan(doublecomplexz); floatcomplexctanf(floatcomplexz); longdoublecomplexctanl(longdoublecomplexz);
Description
[edit | edit source ]These functions compute and return the complex tangent value.
cacosh
[edit | edit source ]Prototype
[edit | edit source ]doublecomplexcacosh(doublecomplexz); floatcomplexcacoshf(floatcomplexz); longdoublecomplexcacoshl(longdoublecomplexz);
Description
[edit | edit source ]These functions shall return the complex arc hyperbolic cosine value, in the range of a half-strip of non-negative values along the real axis and in the interval [-iπ, +iπ] along the imaginary axis.
casinh
[edit | edit source ]Prototype
[edit | edit source ]doublecomplexcasinh(doublecomplexz); floatcomplexcasinhf(floatcomplexz); longdoublecomplexcasinhl(longdoublecomplexz);
Description
[edit | edit source ]casinh
is one of the Standard C library functions in the complex.h header file. It is used to calculate the complex and inverse hyperbolic sine of given angle or number. Just like sine operator has inverse as sin inverse, hyperbolic sine of complex number has this as an inverse function.
This function returns complex arc hyperbolic sine,in the range mathematically unbounded along real axis and in the interval {\displaystyle [-i\pi /2,+i\pi /2]} along imaginary axis.
catanh
[edit | edit source ]Prototype
[edit | edit source ]doublecomplexcatanh(doublecomplexz); floatcomplexcatanhf(floatcomplexz); longdoublecomplexcatanhl(longdoublecomplexz);
Description
[edit | edit source ]These functions shall return the complex arc hyperbolic tangent value, in the range of a strip mathematically unbounded along the real axis and in the interval [-iπ/2, +iπ/2] along the imaginary axis.
ccosh
[edit | edit source ]Prototype
[edit | edit source ]doublecomplexccosh(doublecomplexz); floatcomplexccoshf(floatcomplexz); longdoublecomplexccoshl(longdoublecomplexz);
Description
[edit | edit source ]These functions compute and return the complex hyperbolic cosine value.
csinh
[edit | edit source ]Prototype
[edit | edit source ]doublecomplexcsinh(doublecomplexz); floatcomplexcsinhf(floatcomplexz); longdoublecomplexcsinhl(longdoublecomplexz);
Description
[edit | edit source ]These functions compute and return the complex hyperbolic sine value.
ctanh
[edit | edit source ]Prototype
[edit | edit source ]doublecomplexctanh(doublecomplexz); floatcomplexctanhf(floatcomplexz); longdoublecomplexctanhl(longdoublecomplexz);
Description
[edit | edit source ]These functions compute and return the complex hyperbolic tangent value.
cexp
[edit | edit source ]Prototype
[edit | edit source ]doublecomplexcexp(doublecomplexz); floatcomplexcexpf(floatcomplexz); longdoublecomplexcexpl(longdoublecomplexz);
Description
[edit | edit source ]These functions compute and return the complex exponential value of z.
clog
[edit | edit source ]Prototype
[edit | edit source ]doublecomplexclog(doublecomplexz); floatcomplexclogf(floatcomplexz); longdoublecomplexclogl(longdoublecomplexz);
Description
[edit | edit source ]These functions shall return the complex natural logarithm value, in the range of a strip mathematically unbounded along the real axis and in the interval [-iπ, +iπ] along the imaginary axis.
cabs
[edit | edit source ]Prototype
[edit | edit source ]doublecabs(doublecomplexz); floatcabsf(floatcomplexz); longdoublecabsl(longdoublecomplexz);
Description
[edit | edit source ]These functions compute and return the complex absolute value.
cpow
[edit | edit source ]Prototype
[edit | edit source ]doublecomplexcpow(doublecomplexx,doublecomplexy); floatcomplexcpowf(floatcomplexx,floatcomplexy); longdoublecomplexcpowl(longdoublecomplexx,longdoublecomplexy);
Description
[edit | edit source ]
Cpow is a library function in the C programming language, used to calculate powers in the field of complex numbers
It was added to the C programming language, together with complex number support, in the C99 standard.
doublecomplexcpow(doublecomplexx,doublecomplexy);
This function calculates the power of real number 'x' raised to y-th power ,where y is a complex number .
In mathematics ,by Euler's formula, eia = (cos a +i sin a).Here,cos and sin are trigonometric functions.
For xia,
xi .a = ei .a ln(x) = ( cos(a ln(x)) + i sin(a ln(x)) ) ; ln : logarithmic function to the base e.
csqrt
[edit | edit source ]Prototype
[edit | edit source ]doublecomplexcsqrt(doublecomplexz); floatcomplexcsqrtf(floatcomplexz); longdoublecomplexcsqrtl(longdoublecomplexz);
Description
[edit | edit source ]These functions compute and return the complex square root value, in the range of the right half-plane (including the imaginary axis).
carg
[edit | edit source ]Prototype
[edit | edit source ]doublecarg(doublecomplexz); floatcargf(floatcomplexz); longdoublecargl(longdoublecomplexz);
Description
[edit | edit source ]carg is a standard library function which calculates the argument (phase angle) of a complex number. It takes a single parameter and returns the phase angle of that value (converted if necessary to a complex number) within the range [π, −π].
This function takes a single parameter of type complex and returns a result of type double.
A complex number can be represented:
- in rectangular co-ordinates as {\displaystyle Z=A+Bi}
- in polar co-ordinates as {\displaystyle z=re^{ia}}
where:
- A = creal(Z) is the real part
- B = cimag(Z) is the imaginary part
- r = cabs(z) is the radius
- a = carg(z) is the phase (angle or the argument)
Hence this function returns phase of complex number Z used in polar co-ordinates. The return value is in radians, in the range [π, -π]. When we use this function, we must include the <complex.h> header file.
cimag
[edit | edit source ]Prototype
[edit | edit source ]doublecimag(doublecomplexz); floatcimagf(floatcomplexz); longdoublecimagl(longdoublecomplexz);
Description
[edit | edit source ]cimag is a complex function in c programming. As complex numbers contain two parts, one real part and one imaginary part, this function is used to declare the imaginary part of a complex number. For example, let 'M' be any complex number which can be represented using c functions as follows:
- M = creal(M) + cimag(M) * i
- where creal(M) = real part of M.
- The function returns the imaginary part of the complex no.
conj
[edit | edit source ]Prototype
[edit | edit source ]doublecomplexconj(doublecomplexz); floatcomplexconjf(floatcomplexz); longdoublecomplexconjl(longdoublecomplexz);
Description
[edit | edit source ]These functions compute and return the complex conjugate value.
cproj is a standard C programming language function.
cproj
[edit | edit source ]Prototype
[edit | edit source ]doublecomplexcproj(doublecomplexz); floatcomplexcprojf(floatcomplexz); longdoublecomplexcprojl(longdoublecomplexz);
Description
[edit | edit source ]Used to compute complex projection functions. The values which have to be projected are specified by z. This is complex projection functions. these are available for integrity servers. The projection of complex floating point-number z onto the Riemann sphere is done by cproj(). But all complex infinities are projected to positive infinity on the real axis. The cproj() return the value of projection on Riemann sphere.
creal
[edit | edit source ]Prototype
[edit | edit source ]doublecreal(doublecomplexz); floatcrealf(floatcomplexz); longdoublecreall(longdoublecomplexz);
Description
[edit | edit source ]These functions compute and return the real part value.
References
[edit | edit source ]- ↑ "ccos(3) - Linux man page". die.net. Retrieved 20 September 2011.