Complex class abstract
Representation of a complex number, i.e. a number which has both a real and imaginary part.
Implementations of arithmetic operations handle NaN
and
infinite values according to the rules for double, i.e.
== is an equivalence relation for all instances that have
a NaN
in either real or imaginary part, e.g. the following are
considered equal:
1 + NaNi
NaN + i
NaN + NaNi
Note that this is in contradiction with the IEEE-754 standard for floating
point numbers (according to which the test x == x
must fail if
x
is NaN
).
- Implementers
- Available Extensions
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- imaginary → double
-
The imaginary part.
no setter
- isFinite → bool
-
True if the real and imaginary parts are finite; otherwise, false.
no setter
- isInfinite → bool
-
True if the real and imaginary parts are positive infinity or negative
infinity; otherwise, false.
no setter
- isNaN → bool
-
True if the real and imaginary parts are the double Not-a-Number value;
otherwise, false.
no setter
- real → double
-
The real part.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
abs(
) → double -
Return the absolute value of this complex number.
Returns
NaN
if either real or imaginary part isNaN
anddouble.INFINITY
if neither part isNaN
, but at least one part is infinite. -
argument(
) → double - Compute the argument of this complex number.
-
conjugate(
) → Complex -
Return the conjugate of this complex number.
The conjugate of
a + bi
isa - bi
. -
exp(
) → Complex - Compute the exponential function of this complex number.
-
log(
) → Complex - Compute the natural logarithm of this complex number.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pow(
num x) → Complex -
Returns of value of this complex number raised to the power of
x
. -
power<
T extends Complex> (T x) → Complex -
Returns of value of this complex number raised to the power of
x
. -
reciprocal(
) → Complex -
Returns the multiplicative inverse of
this
element. -
sqrt(
) → Complex - Compute the square root of this complex number.
-
sqrt1z(
) → Complex -
Compute the square root
of
1 - this^2
for this complex number. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator *(
Object factor) → Complex -
Returns a
Complex
whose value isthis * factor
. Implements preliminary checks forNaN
and infinity followed by the definitional formula: -
operator +(
Object addend) → Complex -
Returns a
Complex
whose value is(this + addend)
. Uses the definitional formula -
operator -(
Object subtrahend) → Complex -
Returns a
Complex
whose value isthis - subtrahend
. Uses the definitional formula -
operator /(
Object divisor) → Complex -
Returns a
Complex
whose value is(this / divisor)
. Implements the definitional formula -
operator ==(
Object other) → bool -
Test for equality with another object.
override
-
operator unary-(
) → Complex -
Negate operator. Returns a
Complex
whose value is-this
. ReturnsNAN
if either real or imaginary part of this complex number equalsdouble.nan
.
Constants
- i → const Cartesian
- The square root of -1. A number representing "0.0 + 1.0i"
- infinity → const Cartesian
- A complex number representing "+INF + INFi"
- nan → const Cartesian
- A complex number representing "NaN + NaNi"
- one → const Cartesian
- A complex number representing "1.0 + 0.0i"
- zero → const Cartesian
- A complex number representing "0.0 + 0.0i"