Complex numbers

(directly go to documentation on : Complex, Re, Im, I, Conjugate, Arg. )

# 9. Complex numbers

Yacas understands the concept of a complex number, and has a few functions that allow manipulation of complex numbers.

Complex | construct a complex number
Re | real part of a complex number
Im | imaginary part of a complex number
I | imaginary unit
Conjugate | complex conjugate
Arg | argument of a complex number

###

Complex -- construct a complex number

##### Standard library

##### Calling format:

    Complex(r, c)

##### Parameters:

`r` -- real part

`c` -- imaginary part

##### Description:

This function represents the complex number "r + I*c", where "I" is the imaginary unit. It is the standard representation used in Yacas to represent complex numbers. Both "r" and "c" are supposed to be real.

Note that, at the moment, many functions in Yacas assume that all numbers are real unless it is obvious that it is a complex number. Hence `Im(Sqrt(x))` evaluates to `0` which is only true for nonnegative "x".

##### Examples:

    In> I
    Out> Complex(0,1);
    In> 3+4*I
    Out> Complex(3,4);
    In> Complex(-2,0)
    Out> -2;

##### See also:

Re , Im , I , Abs , Arg .

###

Re -- real part of a complex number

##### Standard library

##### Calling format:

    Re(x)

##### Parameters:

`x` -- argument to the function

##### Description:

This function returns the real part of the complex number "x".

##### Examples:

    In> Re(5)
    Out> 5;
    In> Re(I)
    Out> 0;
    In> Re(Complex(3,4))
    Out> 3;

##### See also:

Complex , Im .

###

Im -- imaginary part of a complex number

##### Standard library

##### Calling format:

    Im(x)

##### Parameters:

`x` -- argument to the function

##### Description:

This function returns the imaginary part of the complex number "x".

##### Examples:

    In> Im(5)
    Out> 0;
    In> Im(I)
    Out> 1;
    In> Im(Complex(3,4))
    Out> 4;

##### See also:

Complex , Re .

###

I -- imaginary unit

##### Standard library

##### Calling format:

    I

##### Description:

This symbol represents the imaginary unit, which equals the square root of -1. It evaluates to `Complex(0,1)`.

##### Examples:

    In> I
    Out> Complex(0,1);
    In> I = Sqrt(-1)
    Out> True;

##### See also:

Complex .

###

Conjugate -- complex conjugate

##### Standard library

##### Calling format:

    Conjugate(x)

##### Parameters:

`x` -- argument to the function

##### Description:

This function returns the complex conjugate of "x". The complex conjugate of a+I*b is a-I*b. This function assumes that all unbound variables are real.

##### Examples:

    In> Conjugate(2)
    Out> 2;
    In> Conjugate(Complex(a,b))
    Out> Complex(a,-b);

##### See also:

Complex , Re , Im .

###

Arg -- argument of a complex number

##### Standard library

##### Calling format:

    Arg(x)

##### Parameters:

`x` -- argument to the function

##### Description:

This function returns the argument of "x". The argument is the angle with the positive real axis in the Argand diagram, or the angle "phi" in the polar representation r*Exp(I*phi) of "x". The result is in the range (-Pi, Pi], that is, excluding -Pi but including Pi. The argument of 0 is `Undefined`.

##### Examples:

    In> Arg(2)
    Out> 0;
    In> Arg(-1)
    Out> Pi;
    In> Arg(1+I)
    Out> Pi/4;

##### See also:

Abs , Sign .