numpy.polysub

numpy.polysub(a1, a2)

Returns difference from subtraction of two polynomials input as sequences.

Returns difference of polynomials; a1 - a2. Input polynomials are represented as an array_like sequence of terms or a poly1d object.

Parameters:

a1 : {array_like, poly1d}

Minuend polynomial as sequence of terms.

a2 : {array_like, poly1d}

Subtrahend polynomial as sequence of terms.

Returns:

out : {ndarray, poly1d}

Array representing the polynomial terms.

Examples

(2 x^2 + 10x - 2) - (3 x^2 + 10x -4) = (-x^2 + 2)

>>> np.polysub([2, 10, -2], [3, 10, -4])
array([-1,  0,  2])

Previous topic

numpy.polymul

Next topic

numpy.RankWarning

This Page

Quick search