# Dom::Complex

Field of complex numbers

### Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

## Syntax

```Dom::Complex(`x`)
```

## Description

`Dom::Complex` is the domain of complex constants represented by expressions of type `DOM_INT`, `DOM_RAT`, `DOM_FLOAT` or `DOM_COMPLEX`. An expression of type `DOM_EXPR` is considered a complex number if it is of type `Type::Arithmetical` and if it contains only indeterminates which are of type `Type::ConstantIdents` or if it contains no indeterminates, cf. Example 2.

`Dom::Complex` is of category `Cat::Field` due to pragmatism. This domain actually is not a field because ```bool(1.0 = float(3) / float(3))``` returns `FALSE`, for example.

Elements of `Dom::Complex` are usually not created explicitly. However, if one creates elements using the usual syntax, it is checked whether the input expression can be converted to a number. This means `Dom::Complex` is a facade domain which creates elements of domain type `DOM_INT`, `DOM_RAT`, `DOM_FLOAT`, `DOM_COMPLEX` or `DOM_EXPR`.

`Dom::Complex` has no normal representation, because `0` and `0.0` both represent the zero.

Viewed as a differential ring, `Dom::Complex` is trivial. It only contains constants.

`Dom::Complex` has the domain `Dom::BaseDomain` as its super domain, i.e., it inherits each method which is defined by `Dom::BaseDomain` and not re-implemented by `Dom::Complex`. Methods described below are re-implemented by `Dom::Complex`.

## Superdomain

`Dom::ArithmeticalExpression`

## Axioms

`Ax::systemRep`, `Ax::efficientOperation``("_divide")`, `Ax::efficientOperation``("_mult")`, `Ax::efficientOperation``("_invert")`

## Examples

### Example 1

Creating some complex numbers using `Dom::Complex`:

`Dom::Complex(2/3)`

`Dom::Complex(2/3 + 4*I)`

### Example 2

It's also possible to use expressions or constants for creating an element of `Dom::Complex`:

`Dom::Complex(PI)`

`Dom::Complex(sin(2))`

`Dom::Complex(sin(2/3*I) + 3)`

If the expression cannot be converted to an element of `Dom::Complex` we will get an error message:

`Dom::Complex(sin(x))`
```Error: The arguments are invalid. [Dom::Complex::new] ```

## Parameters

 `x` An expression of type `DOM_INT`, `DOM_RAT`, `DOM_FLOAT`, `DOM_COMPLEX`. An expression of type `DOM_EXPR` is also possible if it is of type `Type::Arithmetical` and if it contains only indeterminates which are of type `Type::ConstantIdents` or if it contains no indeterminates.

## Entries

 "characteristic" the characteristic of this field is 0. "one" the unit element; it equals `1`. "zero" The zero element; it equals `0`.

collapse all

## Mathematical Methods

### `_divide` — Divide numbers

`_divide(x, y)`

### `_invert` — Invert numbers

`_invert(x)`

### `_mult` — Multiplie numbers

`_mult(x, y, …)`

### `_negate` — Negate numbers

`_negate(x)`

### `_plus` — Add numbers

`_plus(x, y, …)`

### `_power` — Power operator

`_power(x, y)`

### `_unequal` — Inequalities

`_unequal(x, y)`

### `conjugate` — Conversion to a basic type

`conjugate(x)`

`D(x)`

### `diff` — Differentiates

`diff(z, <x, …>)`

### `equal` — Equations

`equal(x, y)`

### `expr` — Conversion to a basic type

`expr(x)`

### `iszero` — Zero test

`iszero(x)`

### `norm` — Absolute value of a number

`norm(x)`

### `random` — Random number generation

`random()`

`random(n)`

`random(m .. n)`

`random(n)` returns a random number generator which creates complex random numbers where the real parts and the imaginary parts are positive integers between 0 and n - 1.

`random(m..n)` returns a random number generator which creates complex random numbers where the real parts and the imaginary parts are positive integers between m and n.

### `unequal` — Inequalities

`unequal(x, y)`

## Conversion Methods

### `convert` — Conversion into this domain

`convert(x)`

An arithmetical expression can be converted if it only contains subexpression of the types just mentioned.

If the conversion fails, `FAIL` is returned.

### `convert_to` — Conversion to other domains

`convert_to(x, T)`

If the conversion fails, `FAIL` is returned.

The following domains are allowed for `T`: `DOM_INT`, `Dom::Integer`, `DOM_RAT`, `Dom::Rational`, `DOM_FLOAT`, `Dom::Float`, `Dom::Numerical`, `DOM_COMPLEX` and `DOM_EXPR`.

### `normal` — Normal form of objects

`normal(x)`