Complex class
A high-performance equivalent to C++ <complex>.
Represents a complex number with a real and an imaginary part, providing operations for complex arithmetic and magnitude extraction.
Constructors
Properties
- hashCode → int
-
Returns a hash code based on both the real and imaginary parts.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
abs(
) → double - Computes the magnitude (absolute value) of the complex number.
-
arg(
) → double - Computes the phase angle (argument) of the complex number in radians.
-
conj(
) → Complex - Returns the complex conjugate of the number (real - imag * i).
-
imag(
) → double - Returns the imaginary component of the complex number.
-
norm(
) → double - Computes the squared magnitude of the complex number.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
real(
) → double - Returns the real component of the complex number.
-
toString(
) → String -
Returns a human-readable string in the form
a + biora - bi.override
Operators
-
operator *(
Complex other) → Complex - Multiplies two complex numbers using the standard complex multiplication rule.
-
operator +(
Complex other) → Complex - Adds two complex numbers component-wise.
-
operator -(
Complex other) → Complex -
Subtracts
otherfrom this complex number component-wise. -
operator /(
Complex other) → Complex -
Divides this complex number by
other. -
operator ==(
Object other) → bool -
Returns
trueif both the real and imaginary parts are equal.override