Function reference · Polynomials
coeffs
Returns dense polynomial coefficients from constant term upward.
coeffs(expression[, variable]) collects polynomial coefficients and returns them as a Vector ordered by ascending power.
Examples
These examples use Nerdamer Notation.
Collect the coefficients of a quadratic.
coeffs(x^2+2*x+1,x)
// → [1, 2, 1]Interfaces
The same operation is available through the interfaces below.
Nerdamer Notation
Use this form inside input passed to nerdamer(...).
coeffs(expression[, variable])
Parameters
expression— Polynomial expression whose coefficients should be collected.variable— Optional polynomial variable. Defaults to the first variable in the expression.
nerdamer.coeffs
Call the operation through the default nerdamer import.
nerdamer.coeffs(x: ExpressionInput, variable?: ExpressionInput): Vector
Parameters
| Name | Type | Description |
|---|---|---|
x | ExpressionInput | — |
variable | ExpressionInput | — |
Returns
Direct JavaScript / TypeScript API
Import the operation directly from its package entry point.
import { coeffs } from 'nerdamer/algebra';
coeffs(x: ExpressionInput, variable?: ExpressionInput): Vector
Parameters
| Name | Type | Description |
|---|---|---|
x | ExpressionInput | — |
variable | ExpressionInput | — |
