Dom::Complex -- the field of
complex numbers
IntroductionDom::Complex is the field of complex numbers
represented by elements of the domains DOM_INT, DOM_RAT, DOM_FLOAT, DOM_COMPLEX and DOM_EXPR.
Creating
ElementsDom::Complex(x)
Parametersx |
- | 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. |
Cat::DifferentialRing
Related
DomainsDom::Float, Dom::Integer, Dom::Numerical, Dom::Rational, Dom::Real
DetailsDom::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.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.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.the characteristic of this field is 0.
the unit element; it equals 1.
The zero element; it equals 0.
_divide(dom x, dom
y)_divide._invert(dom x)_invert._mult(dom x, dom
y...)_mult._negate(dom x)_negate._plus(dom x, dom
y...)_plus._power(dom x, dom
y)_power._unequal(dom x, dom
y)_unequal.conjugate(dom x)conjugate.D(dom x)diff(dom z, <, any
x...> )z if it is called with only one
argument. Otherwise it returns 0.equal(dom x, dom
y)_equal.expr(dom x)expr.iszero(dom x)iszero.norm(dom x)random()random.random(integer n)random(integer m..integer n)unequal(dom x, dom
y)_unequal.convert(any x)x to a number of type
Dom::Complex. Currently this method can convert elements
of type DOM_INT,
DOM_RAT, DOM_FLOAT, DOM_COMPLEX. It also can convert
constant identifier like PI, EULER and CATALAN.FAIL is returned.convert_to(dom x, any
T)x to an
element of type T, or if T is not a domain,
to the domain type of T.FAIL is returned.T: DOM_INT, Dom::Integer, DOM_RAT, Dom::Rational, DOM_FLOAT, Dom::Float, Dom::Numerical, DOM_COMPLEX and DOM_EXPR.normal(dom x)normal.
Example
1Creating some complex numbers using
Dom::Complex:
>> Dom::Complex(2/3)
2/3
>> Dom::Complex(2/3 + 4*I)
2/3 + 4 I
Example
2It's also possible to use expressions or constants for
creating an element of Dom::Complex:
>> Dom::Complex(PI)
PI
>> Dom::Complex(sin(2))
sin(2)
>> Dom::Complex(sin(2/3*I) + 3)
I sinh(2/3) + 3
If the expression cannot be converted to an element of
Dom::Complex we will get an error message:
>> Dom::Complex(sin(x))
Error: illegal arguments [Dom::Complex::new]
Super-DomainAx::systemRep
, Ax::efficientOperation("_divide"),
Ax::efficientOperation("_mult"),
Ax::efficientOperation("_invert")