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 · nerdamer API · Direct API

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

NameTypeDescription
xExpressionInput—
variableExpressionInput—

Returns

Vector

Browse the nerdamer API →

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

NameTypeDescription
xExpressionInput—
variableExpressionInput—

Returns

Vector

Browse nerdamer/algebra →

← Back to Function reference