numpy.polyadd(a1, a2) [source]
Find the sum of two polynomials.
Returns the polynomial resulting from the sum of two input polynomials. Each input must be either a poly1d object or a 1D sequence of polynomial coefficients, from highest to lowest degree.
| Parameters: |
|
|---|---|
| Returns: |
|
See also
poly1d
poly, polyadd, polyder, polydiv, polyfit, polyint, polysub, polyval
>>> np.polyadd([1, 2], [9, 5, 4]) array([9, 6, 6])
Using poly1d objects:
>>> p1 = np.poly1d([1, 2]) >>> p2 = np.poly1d([9, 5, 4]) >>> print(p1) 1 x + 2 >>> print(p2) 2 9 x + 5 x + 4 >>> print(np.polyadd(p1, p2)) 2 9 x + 6 x + 6
© 2005–2019 NumPy Developers
Licensed under the 3-clause BSD License.
https://docs.scipy.org/doc/numpy-1.17.0/reference/generated/numpy.polyadd.html