numpy.polynomial.polynomial.polydiv(c1, c2)
[source]
Divide one polynomial by another.
Returns the quotient-with-remainder of two polynomials c1
/ c2
. The arguments are sequences of coefficients, from lowest order term to highest, e.g., [1,2,3] represents 1 + 2*x + 3*x**2
.
Parameters: |
|
---|---|
Returns: |
|
>>> from numpy.polynomial import polynomial as P >>> c1 = (1,2,3) >>> c2 = (3,2,1) >>> P.polydiv(c1,c2) (array([3.]), array([-8., -4.])) >>> P.polydiv(c2,c1) (array([ 0.33333333]), array([ 2.66666667, 1.33333333])) # may vary
© 2005–2019 NumPy Developers
Licensed under the 3-clause BSD License.
https://docs.scipy.org/doc/numpy-1.17.0/reference/generated/numpy.polynomial.polynomial.polydiv.html