Constant class final

Concrete implementation of Algebraic that represents a constant value a. It can be either a real or complex number, such as:

  • P(x) = 5
  • P(x) = 3 + 6i

In the context of a polynomial with one variable, the non-zero constant function is a polynomial of degree 0.

Inheritance

Constructors

Constant({Complex a = const Complex.fromReal(1)})
Concrete implementation of Algebraic that represents a constant value a. It can be either a real or complex number, such as:
Constant.realEquation({double a = 1})
Concrete implementation of Algebraic that represents a constant value a. It can be either a real or complex number, such as:

Properties

a Complex
The constant coefficient.
no setter
coefficients List<Complex>
The polynomial coefficients.
finalinherited
degree num
The degree of the polynomial.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
isRealEquation bool
Determines whether the polynomial is real or not.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

coefficient(int degree) Complex?
Returns the coefficient of the polynomial whose degree is degree. For example:
inherited
copyWith({Complex? a}) Constant
Creates a deep copy of this object and replaces (if non-null) the given values with the old ones.
derivative() Algebraic
The derivative of the polynomial.
override
discriminant() Complex
The polynomial discriminant, if it exists.
override
evaluateIntegralOn(double lower, double upper) Complex
Evaluates the definite integral of the polynomial from lower to upper.
inherited
evaluateOn(Complex x) Complex
Evaluates the polynomial at the given complex value x.
inherited
factor() List<Algebraic>
Factors the polynomial into irreducible factors.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
realEvaluateOn(double x) Complex
Evaluates the polynomial at the given real value x.
inherited
solutions() List<Complex>
Finds the roots (the solutions) of the associated P(x) = 0 equation.
override
solveInequality({required AlgebraicInequalityType inequalityType, double precision = 1e-10}) List<AlgebraicInequalitySolution>
Solves the inequality associated with this polynomial.
inherited
toString() String
A string representation of this object.
inherited
toStringWithFractions() String
Returns a string representation of the polynomial where the coefficients are converted into their fractional representation.
inherited

Operators

operator *(Algebraic other) Algebraic
The product of two polynomials is performed by multiplying the corresponding coefficients of the polynomials.
inherited
operator +(Algebraic other) Algebraic
The sum of two polynomials is performed by adding the corresponding coefficients.
inherited
operator -(Algebraic other) Algebraic
The difference of two polynomials is performed by subtracting the corresponding coefficients.
inherited
operator /(Algebraic other) AlgebraicDivision
This operator divides a polynomial by another polynomial using the polynomial long division algorithm. The returned AlgebraicDivision type is a record type that contains both the quotient and the remainder of the division.
inherited
operator ==(Object other) bool
The equality operator.
inherited
operator [](int index) Complex
Returns the coefficient of the polynomial at the given index position. For example:
inherited
operator unary-() Algebraic
The unary minus operator changes the sign of every coefficient of the polynomial. For example:
inherited