operator unary- method

Algebraic operator unary-()

The 'negation' operator changes the sign of every coefficient of the polynomial. For example:

final poly1 = Linear.realEquation(a: 3, b: -5);
final poly2 = -poly1; // poly2 = Linear.realEquation(a: -3, b: 5);

As you can see, in poly2 all the coefficients have the opposite sign.

Implementation

Algebraic operator -() =>
    Algebraic.from(coefficients.map((c) => -c).toList(growable: false));