Complex class

Complex numbers have both a real and an imaginary part.

Inheritance

Constructors

Complex(Real real, Imaginary imaginary)
Constructs a instance.
Complex.coeff(num realValue, num imagValue)
Constructs a instance from real and imaginary coefficients.
Complex.constant(Real real, Imaginary imaginary)
Constructs a constant Complex number.
const
Complex.fromMap(Map<String, Map<String, dynamic>>? m)
Constructs a instance, applying the values in map m. See toJson for the expected format.

Properties

absoluteSquare Number
Returns the absolute square of this Complex number.
no setter
complexArgument Double
In radians.
no setter
complexModulus Number
Complex modulus represents the magnitude of this complex number in the complex plane. Synonymous with abs().
no setter
complexNorm Number
Complex norm is synonymous with complex modulus and abs().
no setter
conjugate Complex
Returns the conjugate of this Complex number (the sign of the imaginary component is flipped).
no setter
hashCode int
The hash codes for two Numbers will be equal when the represented values are equal, even if the Number subtypes are different.
no setteroverride
imag Imaginary
imag is a convenient getter for the imaginary value
no setter
imaginary Imaginary
The imaginary number component of the complex number.
final
isFinite bool
Whether this Number represents a finite value.
no setterinherited
isInfinite bool
Whether this Number represents infinity.
no setteroverride
isInteger bool
Whether the real part of this complex number is an integer.
no setteroverride
isNaN bool
Whether this Number represents a value .
no setteroverride
isNegative bool
Whether the real part of this complex number is negative.
no setteroverride
phase Double
Phase is synonymous with complex argument.
no setter
real Real
The real number component of the complex number.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sign num
Returns minus one, zero or plus one depending on the sign and numerical value of the number. Returns minus one if the number is less than zero, plus one if the number is greater than zero, and zero if the number is equal to zero. Returns NaN if the number is NaN. Returns an int if this Number's value is an integer, a double otherwise.
no setterinherited

Methods

abs() Number
The absolute value of a Complex number is its distance from zero in the Complex number space (e.g., the absolute value of 3 + 4i = 5). The absolute value is always a real number. Synonymous with complexModulus.
override
ceil() Number
Returns the ceiling of the real portion of this complex number.
override
clamp(dynamic lowerLimit, dynamic upperLimit) Number
Returns a Complex number whose real portion has been clamped to within lowerLimit and upperLimit and whose imaginary portion is the same as the imaginary value in this Complex number.
override
compareTo(dynamic n2) int
Compares this Number to another Number by comparing values. n2 is expected to be a num or Number. If it is not it will be considered to have a value of 0.
inherited
floor() Number
Returns the floor of the real portion of this complex number.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reciprocal() Number
Returns the Number that is the reciprocal of this Number. This Number is unaffected.
override
remainder(dynamic divisor) Number
The remainder method operates on the real portion of this Complex number only.
override
round() Number
Returns the integer closest to the real portion of this complex number.
override
toDouble() double
Returns the real part of this complex number as a double.
override
toInt() int
Returns the real part of this complex number as an integer.
override
toJson() Map<String, dynamic>
Support dart:json stringify.
override
toString() String
A string representation of this object.
override
truncate() Number
Returns the real portion of this complex number, truncated to an Integer.
override

Operators

operator %(dynamic divisor) Number
The modulo operator (not supported).
override
operator *(dynamic multiplicand) Number
Returns the product of this Number and the multiplicand (a Number or num). This Number is unaffected.
override
operator +(dynamic addend) Number
Returns the sum of this Number and a Number or num. This Number is unaffected.
override
operator -(dynamic subtrahend) Number
Returns the difference of this Number and the subtrahend (a Number or num). This Number is unaffected.
override
operator /(dynamic divisor) Number
Returns the quotient of this Number divided by the divisor (a Number or num). This Number is unaffected.
override
operator <(dynamic obj) bool
Returns true if the real component of this Complex number is less than obj. The imaginary part of this complex number is ignored.
override
operator <=(dynamic obj) bool
Returns true if the real component of this Complex number is less than or equal to obj. The imaginary part of this complex number is ignored.
override
operator ==(dynamic obj) bool
Two Numbers will be equal when the represented values are equal, even if the Number subtypes are different.
override
operator >(dynamic obj) bool
Returns true if the real component of this Complex number is greater than obj. The imaginary part of this complex number is ignored.
override
operator >=(dynamic obj) bool
Returns true if the real component of this Complex number is greater than or equal to obj. The imaginary part of this complex number is ignored.
override
operator ^(dynamic exponent) Number
The power operator (note: NOT bitwise XOR). In order to provide a convenient power operator for all Numbers, the number library overrides the caret operator. In Dart the caret operator is ordinarily used for bitwise XOR operations on ints.
override
operator unary-() Complex
Returns the negative of this Number. This Number is unaffected.
override
operator ~/(dynamic divisor) Number
The truncating division operator.
override