Complex 复数

Complex numbers are represented by a dictionary of real and imaginary attributes:

complex( x, y ) — returns a complex number as { re: x, im: y }

complex( x ) — returns a complex number as { re: x, im: 0 }

Real and imaginary part

The separate attributes can be accessed through their respective names,

complex( x, y ).re = x
complex( x, y ).im = y

or with convenience functions:

re( x ) — real part of a real or complex number

real( x ) — real part of a real or complex number

im( x ) — imaginary part of a real or complex number

imag( x ) — imaginary part of a real or complex number

Operator

Since JavaScript does not support operator overloading, functions are available for complex arithmetic:

add( x, y ) — add two real or complex numbers of x+y

add( x, y, z, … ) — add an arbitrary number of real or complex numbers of x+y+z

sub( x, y ) — subtract two real or complex numbers of x-y

mul( x, y ) — multiply two real or complex numbers of x*y

mul( x, y, z, … ) — multiply an arbitrary number of real or complex numbers of x*y*z

div( x, y ) — divide two real or complex numbers of x/y

neg( x ) — negate a real or complex number of -x

inv( x ) — invert a real or complex number of 1/z

pow( x, y ) — power two real or complex numbers of x^y

root( x, y ) — root two real or complex numbers of x^(1/y)

Complex Function 复变函数

Computation

Please convert to complex() and complex operator by tocomplex() before complex computation. Plot complex function for the real domain x by complex2D(), and for complex domain by complex3D().

Complex

complex - complex math
  1. complex2D
    1. re2D(log(x)) show 2 curves of real and imag values in real domain.
    2. im2D(log(x)) show 2 curves of real and imag values in imag domain.
    3. for complex 2 curves of real and imag values in real and imag domain.
    4. complex coloring
    5. color WebXR surface of complex function on complex plane
    6. complex animate(z) or complex2D(z) for phase animation in complex plane, the independent variable must be z.
    7. complex plot(z) for phase and/or modulus in complex plane, the independent variable must be z.
    8. plot complex(z) for phase and/or modulus in complex plane, the independent variable must be z.
  2. complex3D
    1. complex function
    2. Complex Branches
    3. Riemann surface
    4. complex3D(x) for 3 dimensional graph in real, imag and complex domain, where the independent variable must be x.

References

  1. math handbook content 2 chapter 10 complex function
  2. math handbook content 3 chapter 10 complex function
  3. math handbook content 4 chapter 10 complex function
  4. Complex analysis

Home | about | list | wiki | donate | index | forum | help | chat | contact | translated from Chinese | 中文