liba 0.1.15
An algorithm library based on C/C++
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
Loading...
Searching...
No Matches
complex number
Collaboration diagram for complex number:

Data Structures

struct  a_complex
 instance structure for complex number More...
 

Macros

#define A_COMPLEX_C(real, imag)
 
#define a_complex_c(x)
 
#define a_complex_(_, x)
 

Typedefs

typedef struct a_complex a_complex
 instance structure for complex number
 

Functions

static void a_complex_rect (a_complex *ctx, a_real real, a_real imag)
 constructs a complex number from real and imaginary parts
 
void a_complex_polar (a_complex *ctx, a_real rho, a_real theta)
 constructs a complex number from polar form
 
unsigned int a_complex_parse (a_complex *ctx, char const *str)
 parse a string into a complex number
 
a_bool a_complex_eq (a_complex x, a_complex y)
 complex number x is equal to complex number y
 
a_bool a_complex_ne (a_complex x, a_complex y)
 complex number x is not equal to complex number y
 
a_real a_complex_logabs (a_complex z)
 computes the natural logarithm of magnitude of a complex number
 
a_real a_complex_abs2 (a_complex z)
 computes the squared magnitude of a complex number
 
a_real a_complex_abs (a_complex z)
 computes the magnitude of a complex number
 
a_real a_complex_arg (a_complex z)
 computes the phase angle of a complex number
 
void a_complex_proj (a_complex *ctx, a_complex z)
 computes the projection on Riemann sphere
 
void a_complex_proj_ (a_complex *ctx)
 
void a_complex_conj (a_complex *ctx, a_complex z)
 computes the complex conjugate
 
void a_complex_conj_ (a_complex *ctx)
 
void a_complex_neg (a_complex *ctx, a_complex z)
 computes the complex negative
 
void a_complex_neg_ (a_complex *ctx)
 
void a_complex_add (a_complex *ctx, a_complex x, a_complex y)
 addition of complex numbers
 
void a_complex_add_ (a_complex *ctx, a_complex z)
 
void a_complex_add_real (a_complex *ctx, a_complex x, a_real y)
 
void a_complex_add_real_ (a_complex *ctx, a_real x)
 
void a_complex_add_imag (a_complex *ctx, a_complex x, a_real y)
 
void a_complex_add_imag_ (a_complex *ctx, a_real x)
 
void a_complex_sub (a_complex *ctx, a_complex x, a_complex y)
 subtraction of complex numbers
 
void a_complex_sub_ (a_complex *ctx, a_complex z)
 
void a_complex_sub_real (a_complex *ctx, a_complex x, a_real y)
 
void a_complex_sub_real_ (a_complex *ctx, a_real x)
 
void a_complex_sub_imag (a_complex *ctx, a_complex x, a_real y)
 
void a_complex_sub_imag_ (a_complex *ctx, a_real x)
 
void a_complex_mul (a_complex *ctx, a_complex x, a_complex y)
 multiplication of complex numbers
 
void a_complex_mul_ (a_complex *ctx, a_complex z)
 
void a_complex_mul_real (a_complex *ctx, a_complex x, a_real y)
 
void a_complex_mul_real_ (a_complex *ctx, a_real x)
 
void a_complex_mul_imag (a_complex *ctx, a_complex x, a_real y)
 
void a_complex_mul_imag_ (a_complex *ctx, a_real x)
 
void a_complex_div (a_complex *ctx, a_complex x, a_complex y)
 division of complex numbers
 
void a_complex_div_ (a_complex *ctx, a_complex z)
 
void a_complex_div_real (a_complex *ctx, a_complex x, a_real y)
 
void a_complex_div_real_ (a_complex *ctx, a_real x)
 
void a_complex_div_imag (a_complex *ctx, a_complex x, a_real y)
 
void a_complex_div_imag_ (a_complex *ctx, a_real x)
 
void a_complex_inv (a_complex *ctx, a_complex z)
 inverse of a complex number
 
void a_complex_inv_ (a_complex *ctx)
 
void a_complex_sqrt (a_complex *ctx, a_complex z)
 computes the complex square root
 
void a_complex_sqrt_ (a_complex *ctx)
 
void a_complex_sqrt_real (a_complex *ctx, a_real x)
 
void a_complex_pow (a_complex *ctx, a_complex z, a_complex a)
 complex number z raised to complex power a
 
void a_complex_pow_ (a_complex *ctx, a_complex a)
 
void a_complex_pow_real (a_complex *ctx, a_complex z, a_real a)
 complex number z raised to real power a
 
void a_complex_pow_real_ (a_complex *ctx, a_real a)
 
void a_complex_exp (a_complex *ctx, a_complex z)
 computes the complex base-e exponential
 
void a_complex_exp_ (a_complex *ctx)
 
void a_complex_log (a_complex *ctx, a_complex z)
 computes the complex natural logarithm
 
void a_complex_log_ (a_complex *ctx)
 
void a_complex_log2 (a_complex *ctx, a_complex z)
 computes the complex base-2 logarithm
 
void a_complex_log2_ (a_complex *ctx)
 
void a_complex_log10 (a_complex *ctx, a_complex z)
 computes the complex base-10 logarithm
 
void a_complex_log10_ (a_complex *ctx)
 
void a_complex_logb (a_complex *ctx, a_complex z, a_complex b)
 computes the complex base-b logarithm
 
void a_complex_logb_ (a_complex *ctx, a_complex b)
 
void a_complex_sin (a_complex *ctx, a_complex z)
 computes the complex sine
 
void a_complex_sin_ (a_complex *ctx)
 
void a_complex_cos (a_complex *ctx, a_complex z)
 computes the complex cosine
 
void a_complex_cos_ (a_complex *ctx)
 
void a_complex_tan (a_complex *ctx, a_complex z)
 computes the complex tangent
 
void a_complex_tan_ (a_complex *ctx)
 
void a_complex_sec (a_complex *ctx, a_complex z)
 computes the complex secant
 
void a_complex_sec_ (a_complex *ctx)
 
void a_complex_csc (a_complex *ctx, a_complex z)
 computes the complex cosecant
 
void a_complex_csc_ (a_complex *ctx)
 
void a_complex_cot (a_complex *ctx, a_complex z)
 computes the complex cotangent
 
void a_complex_cot_ (a_complex *ctx)
 
void a_complex_asin (a_complex *ctx, a_complex z)
 computes the complex arc sine
 
void a_complex_asin_ (a_complex *ctx)
 
void a_complex_asin_real (a_complex *ctx, a_real x)
 
void a_complex_acos (a_complex *ctx, a_complex z)
 computes the complex arc cosine
 
void a_complex_acos_ (a_complex *ctx)
 
void a_complex_acos_real (a_complex *ctx, a_real x)
 
void a_complex_atan (a_complex *ctx, a_complex z)
 computes the complex arc tangent
 
void a_complex_atan_ (a_complex *ctx)
 
void a_complex_asec (a_complex *ctx, a_complex z)
 computes the complex arc secant
 
void a_complex_asec_ (a_complex *ctx)
 
void a_complex_asec_real (a_complex *ctx, a_real x)
 
void a_complex_acsc (a_complex *ctx, a_complex z)
 computes the complex arc cosecant
 
void a_complex_acsc_ (a_complex *ctx)
 
void a_complex_acsc_real (a_complex *ctx, a_real x)
 
void a_complex_acot (a_complex *ctx, a_complex z)
 computes the complex arc cotangent
 
void a_complex_acot_ (a_complex *ctx)
 
void a_complex_sinh (a_complex *ctx, a_complex z)
 computes the complex hyperbolic sine
 
void a_complex_sinh_ (a_complex *ctx)
 
void a_complex_cosh (a_complex *ctx, a_complex z)
 computes the complex hyperbolic cosine
 
void a_complex_cosh_ (a_complex *ctx)
 
void a_complex_tanh (a_complex *ctx, a_complex z)
 computes the complex hyperbolic tangent
 
void a_complex_tanh_ (a_complex *ctx)
 
void a_complex_sech (a_complex *ctx, a_complex z)
 computes the complex hyperbolic secant
 
void a_complex_sech_ (a_complex *ctx)
 
void a_complex_csch (a_complex *ctx, a_complex z)
 computes the complex hyperbolic cosecant
 
void a_complex_csch_ (a_complex *ctx)
 
void a_complex_coth (a_complex *ctx, a_complex z)
 computes the complex hyperbolic cotangent
 
void a_complex_coth_ (a_complex *ctx)
 
void a_complex_asinh (a_complex *ctx, a_complex z)
 computes the complex arc hyperbolic sine
 
void a_complex_asinh_ (a_complex *ctx)
 
void a_complex_acosh (a_complex *ctx, a_complex z)
 computes the complex arc hyperbolic cosine
 
void a_complex_acosh_ (a_complex *ctx)
 
void a_complex_acosh_real (a_complex *ctx, a_real x)
 
void a_complex_atanh (a_complex *ctx, a_complex z)
 computes the complex arc hyperbolic tangent
 
void a_complex_atanh_ (a_complex *ctx)
 
void a_complex_atanh_real (a_complex *ctx, a_real x)
 
void a_complex_asech (a_complex *ctx, a_complex z)
 computes the complex arc hyperbolic secant
 
void a_complex_asech_ (a_complex *ctx)
 
void a_complex_acsch (a_complex *ctx, a_complex z)
 computes the complex arc hyperbolic cosecant
 
void a_complex_acsch_ (a_complex *ctx)
 
void a_complex_acoth (a_complex *ctx, a_complex z)
 computes the complex arc hyperbolic cotangent
 
void a_complex_acoth_ (a_complex *ctx)
 

Detailed Description

Macro Definition Documentation

◆ a_complex_

#define a_complex_ ( _,
x )
Value:
a_cast_s(a_complex _, x)
instance structure for complex number
Definition complex.h:30

◆ A_COMPLEX_C

#define A_COMPLEX_C ( real,
imag )
Value:
{a_real_c(real), a_real_c(imag)}
#define a_real_c(x)
static cast to floating-point number
Definition a.h:1003

constructs a complex number from real and imaginary parts

◆ a_complex_c

#define a_complex_c ( x)
Value:
a_cast_s(a_complex, x)

static cast to complex number

Function Documentation

◆ a_complex_abs()

a_real a_complex_abs ( a_complex z)

computes the magnitude of a complex number

Parameters
za complex number
Returns
= a2+b2

◆ a_complex_abs2()

a_real a_complex_abs2 ( a_complex z)

computes the squared magnitude of a complex number

Parameters
za complex number
Returns
= a2+b2

◆ a_complex_acos()

void a_complex_acos ( a_complex * ctx,
a_complex z )

computes the complex arc cosine

Parameters
ctx= arccos(z)
za complex number

◆ a_complex_acosh()

void a_complex_acosh ( a_complex * ctx,
a_complex z )

computes the complex arc hyperbolic cosine

arccosh(z)=log(zz21)

Parameters
ctx= arccosh(z)
za complex number

◆ a_complex_acot()

void a_complex_acot ( a_complex * ctx,
a_complex z )

computes the complex arc cotangent

arccot(z)=arctan(1z)

Parameters
ctx= arccot(z)
za complex number

◆ a_complex_acoth()

void a_complex_acoth ( a_complex * ctx,
a_complex z )

computes the complex arc hyperbolic cotangent

arccoth(z)=arctanh(1z)

Parameters
ctx= arccoth(z)
za complex number

◆ a_complex_acsc()

void a_complex_acsc ( a_complex * ctx,
a_complex z )

computes the complex arc cosecant

arccsc(z)=arcsin(1z)

Parameters
ctx= arccsc(z)
za complex number

◆ a_complex_acsch()

void a_complex_acsch ( a_complex * ctx,
a_complex z )

computes the complex arc hyperbolic cosecant

arccsch(z)=arcsinh(1z)

Parameters
ctx= arccsch(z)
za complex number

◆ a_complex_add()

void a_complex_add ( a_complex * ctx,
a_complex x,
a_complex y )

addition of complex numbers

(a+bi)+(c+di)=(a+c)+(b+d)i

Parameters
ctx= x+y
xcomplex number on the left
ycomplex number on the right

◆ a_complex_arg()

a_real a_complex_arg ( a_complex z)

computes the phase angle of a complex number

Parameters
za complex number
Returns
= arctanba

◆ a_complex_asec()

void a_complex_asec ( a_complex * ctx,
a_complex z )

computes the complex arc secant

arcsec(z)=arccos(1z)

Parameters
ctx= arcsec(z)
za complex number

◆ a_complex_asech()

void a_complex_asech ( a_complex * ctx,
a_complex z )

computes the complex arc hyperbolic secant

arcsech(z)=arccosh(1z)

Parameters
ctx= arcsech(z)
za complex number

◆ a_complex_asin()

void a_complex_asin ( a_complex * ctx,
a_complex z )

computes the complex arc sine

Parameters
ctx= arcsin(z)
za complex number

◆ a_complex_asinh()

void a_complex_asinh ( a_complex * ctx,
a_complex z )

computes the complex arc hyperbolic sine

Parameters
ctx= arcsinh(z)
za complex number

◆ a_complex_atan()

void a_complex_atan ( a_complex * ctx,
a_complex z )

computes the complex arc tangent

Parameters
ctx= arctan(z)
za complex number

◆ a_complex_atanh()

void a_complex_atanh ( a_complex * ctx,
a_complex z )

computes the complex arc hyperbolic tangent

Parameters
ctx= arctanh(z)
za complex number

◆ a_complex_conj()

void a_complex_conj ( a_complex * ctx,
a_complex z )

computes the complex conjugate

Parameters
ctx= (a,bi)
za complex number

◆ a_complex_cos()

void a_complex_cos ( a_complex * ctx,
a_complex z )

computes the complex cosine

cos(z)=exp(zi)+exp(zi)2

Parameters
ctx= cos(z)
za complex number

◆ a_complex_cosh()

void a_complex_cosh ( a_complex * ctx,
a_complex z )

computes the complex hyperbolic cosine

cosh(z)=exp(z)+exp(z)2

Parameters
ctx= cosh(z)
za complex number

◆ a_complex_cot()

void a_complex_cot ( a_complex * ctx,
a_complex z )

computes the complex cotangent

cot(z)=1tan(z)

Parameters
ctx= cot(z)
za complex number

◆ a_complex_coth()

void a_complex_coth ( a_complex * ctx,
a_complex z )

computes the complex hyperbolic cotangent

coth(z)=1tanh(z)

Parameters
ctx= coth(z)
za complex number

◆ a_complex_csc()

void a_complex_csc ( a_complex * ctx,
a_complex z )

computes the complex cosecant

csc(z)=1sin(z)

Parameters
ctx= csc(z)
za complex number

◆ a_complex_csch()

void a_complex_csch ( a_complex * ctx,
a_complex z )

computes the complex hyperbolic cosecant

csch(z)=1sinh(z)

Parameters
ctx= csch(z)
za complex number

◆ a_complex_div()

void a_complex_div ( a_complex * ctx,
a_complex x,
a_complex y )

division of complex numbers

(a+bi)(c+di)=(a+bi)(cdi)(c+di)(cdi)=ac+bciadibdi2c2(di)2=(ac+bd)+(bcad)ic2+d2=(ac+bdc2+d2)+(bcadc2+d2)i

Parameters
ctx= x÷y
xcomplex number on the left
ycomplex number on the right

◆ a_complex_eq()

a_bool a_complex_eq ( a_complex x,
a_complex y )

complex number x is equal to complex number y

Parameters
xcomplex number on the left
ycomplex number on the right
Returns
result of comparison

◆ a_complex_exp()

void a_complex_exp ( a_complex * ctx,
a_complex z )

computes the complex base-e exponential

Parameters
ctx= ez
za complex number

◆ a_complex_inv()

void a_complex_inv ( a_complex * ctx,
a_complex z )

inverse of a complex number

abia2+b2=(aa2+b2)(ba2+b2)i

Parameters
ctxinverse or reciprocal 1z
za complex number

◆ a_complex_log()

void a_complex_log ( a_complex * ctx,
a_complex z )

computes the complex natural logarithm

Parameters
ctx= lnz
za complex number

◆ a_complex_log10()

void a_complex_log10 ( a_complex * ctx,
a_complex z )

computes the complex base-10 logarithm

Parameters
ctx= lgz
za complex number

◆ a_complex_log2()

void a_complex_log2 ( a_complex * ctx,
a_complex z )

computes the complex base-2 logarithm

Parameters
ctx= log2z
za complex number

◆ a_complex_logabs()

a_real a_complex_logabs ( a_complex z)

computes the natural logarithm of magnitude of a complex number

Parameters
za complex number
Returns
= log|x|

◆ a_complex_logb()

void a_complex_logb ( a_complex * ctx,
a_complex z,
a_complex b )

computes the complex base-b logarithm

Parameters
ctx= logbz
za complex number
ba complex number

◆ a_complex_mul()

void a_complex_mul ( a_complex * ctx,
a_complex x,
a_complex y )

multiplication of complex numbers

(a+bi)(c+di)=ac+bci+adi+bdi2=(acbd)+(bc+ad)i

Parameters
ctx= x×y
xcomplex number on the left
ycomplex number on the right

◆ a_complex_ne()

a_bool a_complex_ne ( a_complex x,
a_complex y )

complex number x is not equal to complex number y

Parameters
xcomplex number on the left
ycomplex number on the right
Returns
result of comparison

◆ a_complex_neg()

void a_complex_neg ( a_complex * ctx,
a_complex z )

computes the complex negative

Parameters
ctx= (a,bi)
za complex number

◆ a_complex_parse()

unsigned int a_complex_parse ( a_complex * ctx,
char const * str )

parse a string into a complex number

Parameters
ctxpoints to an instance structure for complex number
strcomplex number string to be parsed
Returns
number of parsed characters

◆ a_complex_polar()

void a_complex_polar ( a_complex * ctx,
a_real rho,
a_real theta )

constructs a complex number from polar form

Parameters
ctx= (ρcosθ,ρsinθi)
rhoa distance from a reference point
thetaan angle from a reference direction

◆ a_complex_pow()

void a_complex_pow ( a_complex * ctx,
a_complex z,
a_complex a )

complex number z raised to complex power a

Parameters
ctx= za
za complex number
aa complex number

◆ a_complex_pow_real()

void a_complex_pow_real ( a_complex * ctx,
a_complex z,
a_real a )

complex number z raised to real power a

Parameters
ctx= za
za complex number
aa real number

◆ a_complex_proj()

void a_complex_proj ( a_complex * ctx,
a_complex z )

computes the projection on Riemann sphere

Parameters
ctx= z or (inf,copysign(0,b)i)
za complex number

◆ a_complex_rect()

static void a_complex_rect ( a_complex * ctx,
a_real real,
a_real imag )
inlinestatic

constructs a complex number from real and imaginary parts

Parameters
ctx= (Re,Im)
realreal part of complex number
imagimaginary part of complex number

◆ a_complex_sec()

void a_complex_sec ( a_complex * ctx,
a_complex z )

computes the complex secant

sec(z)=1cos(z)

Parameters
ctx= sec(z)
za complex number

◆ a_complex_sech()

void a_complex_sech ( a_complex * ctx,
a_complex z )

computes the complex hyperbolic secant

sech(z)=1cosh(z)

Parameters
ctx= sech(z)
za complex number

◆ a_complex_sin()

void a_complex_sin ( a_complex * ctx,
a_complex z )

computes the complex sine

sin(z)=exp(zi)exp(zi)2i

Parameters
ctx= sin(z)
za complex number

◆ a_complex_sinh()

void a_complex_sinh ( a_complex * ctx,
a_complex z )

computes the complex hyperbolic sine

sinh(z)=exp(z)exp(z)2

Parameters
ctx= sinh(z)
za complex number

◆ a_complex_sqrt()

void a_complex_sqrt ( a_complex * ctx,
a_complex z )

computes the complex square root

Parameters
ctx= z
za complex number

◆ a_complex_sub()

void a_complex_sub ( a_complex * ctx,
a_complex x,
a_complex y )

subtraction of complex numbers

(a+bi)(c+di)=(ac)+(bd)i

Parameters
ctx= xy
xcomplex number on the left
ycomplex number on the right

◆ a_complex_tan()

void a_complex_tan ( a_complex * ctx,
a_complex z )

computes the complex tangent

tan(z)=sin(z)cos(z)

Parameters
ctx= tan(z)
za complex number

◆ a_complex_tanh()

void a_complex_tanh ( a_complex * ctx,
a_complex z )

computes the complex hyperbolic tangent

tanh(z)=sinh(z)cosh(z)

Parameters
ctx= tanh(z)
za complex number