Imaginary class

Represents an imaginary number, defined as a number whose square is negative one.

An imaginary number is usually displayed as a value followed by small letter 'i'. 'i' squared is defined as -1 (or equivalently, the square root of -1 is defined as 'i').

Inheritance

Constructors

Imaginary(dynamic val)
Constructs a instance.
Imaginary.constant(Real value)
Constructs a constant Imaginary number.
const
Imaginary.fromMap(Map<String, Map<String, dynamic>>? m)
Constructs a instance, applying the values in map m.
factory

Properties

complexArgument num
The complex argument, or phase, of this imaginary number in radians.
no setter
complexModulus Number
The complex modulus is the absolute value of this Imaginary number.
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
isFinite bool
Whether this Number represents a finite value.
no setterinherited
isInfinite bool
Always returns false as the value in the real dimension is 0. To find whether the imaginary component is infinite use value.isInfinite.
no setteroverride
isInteger bool
Always returns true as the value in the real dimension is 0. To find whether the imaginary component is an integer use value.isInteger.
no setteroverride
isNaN bool
Always returns false as the value in the real dimension is 0. To find whether the imaginary component is NaN use value.isNaN.
no setteroverride
isNegative bool
Always returns false as the value in the real dimension is 0. To find whether the imaginary component is negative use value.isNegative.
no setteroverride
phase num
The phase is synonymous with the complex argument.
no setter
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
value Real
The value of the imaginary component as a Real number.
final

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 0 + 4i = 4). The absolute value is always a real number.
override
ceil() Number
The integer ceiling of a purely imaginary number is always zero.
override
clamp(dynamic lowerLimit, dynamic upperLimit) Number
Clamps the real portion of a complex number having this imaginary value.
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
The integer floor of a purely imaginary number is always zero.
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 real remainder will always be zero.
override
round() Number
The nearest integer of a purely imaginary number is always zero.
override
toComplex() Complex
Returns a Complex number equivalent to this Imaginary number.
toDouble() double
Always returns zero.
override
toInt() int
Always returns zero.
override
toJson() Map<String, dynamic>
Support dart:convert json.
override
toString() String
A string representation of this object.
override
truncate() Number
The integer resulting from truncation of a purely imaginary number is always zero.
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 whether the value of this Number is less than the value of obj (a Number or num).
override
operator <=(dynamic obj) bool
Returns whether the value of this Number is less than or equal to the value of obj (a Number or num).
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
If obj is an Imaginary number then the comparison is made in the imaginary dimension (for example, 5i > 3i is true).
override
operator >=(dynamic obj) bool
Returns whether the value of this Number is greater than or equal to the value of obj (a Number or num).
override
operator ^(dynamic exponent) Number
The power operator (note: NOT bitwise XOR).
override
operator unary-() Imaginary
Returns the negative of this Number. This Number is unaffected.
override
operator ~/(dynamic divisor) Number
The truncating division operator.
override