Complex<T extends num, E extends num> class

Representation of Dart imaginary numbers containing complex specific constants and operations and specializations of operations

Constructors

Complex([T? real, E? imaginary])
Initializing a complex number
factory
Complex.parse(String source)
Parse source as a Complex literal and return its value.
factory

Properties

hashCode int
Returns a hash code for a both real and imaginary values.
no setteroverride
imaginary → E
returns the imaginary part value without the i symbol
no setter
real → T
returns the real part value
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

asType<R extends num, I extends num>() Complex<R, I>
casting the Complex to specific type
isClose(Complex<num, num> other, {double relTol = 1e-09, double absTotal = 0.0}) bool
Return true if the values Complex and other are close to each other and false otherwise. Whether or not two values are considered close is determined according to given absolute and relative tolerances. relTol is the relative tolerance – it is the maximum allowed difference between Complex and other, relative to the larger absolute value of Complex and other. For example, to set a tolerance of 5%, pass relTol:0.05. The default tolerance is 1e-09, which assures that the two values are the same within about 9 decimal digits. relTol must be greater than zero absTotal is the minimum absolute tolerance – useful for comparisons near zero absTotal must be at least zero.
isFinite() bool
Return true if both the real and imaginary parts of Complex are finite, otherwise return false.
isInfinite() bool
Return true if either the real or the imaginary part of Complex is an infinity, otherwise return false.
isNaN() bool
Return true if either the real or the imaginary part of Complex is a NaN, and false otherwise.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
Provide a representation of this Complex value.
override

Operators

operator *(Complex<num, num> other) Complex<num, num>
operator +(Complex<num, num> other) Complex<num, num>
operator -(Complex<num, num> other) Complex<num, num>
operator /(Complex<num, num> other) Complex<num, num>
operator ==(Object other) bool
The equality operator.
override

Static Methods

infinite() Complex<double, double>
Floating-point positive infinity. Equivalent to
infinitei() Complex<double, double>
Complex number with zero real part and positive infinity imaginary part. Equivalent to
nan() Complex<double, double>
A floating-point “not a number” (NaN) value. Equivalent to
nani() Complex<double, double>
Complex number with zero real part and NaN imaginary part. Equivalent to
tryParse<R extends num, I extends num>(String source) Complex<R, I>?
Parse source as a complex literal and return its value.