NumPy

Previous topic

numpy.polynomial.polynomial.polytrim

Next topic

Chebyshev Series (numpy.polynomial.chebyshev)

This is documentation for an old release of NumPy (version 1.19). Read this page in the documentation of the latest stable release (version 2.2).

numpy.polynomial.polynomial.polyline

numpy.polynomial.polynomial.polyline(off, scl)[source]

Returns an array representing a linear polynomial.

Parameters
off, sclscalars

The “y-intercept” and “slope” of the line, respectively.

Returns
yndarray

This module’s representation of the linear polynomial off + scl*x.

See also

chebline

Examples

>>>
>>> from numpy.polynomial import polynomial as P
>>> P.polyline(1,-1)
array([ 1, -1])
>>> P.polyval(1, P.polyline(1,-1)) # should be 0
0.0