Equana

Back to Polynomials

poly

Construct a polynomial from its roots.

Syntax

poly(roots) → r

Backends

TypeScriptnumwa

Description

Construct a polynomial from its roots.

Parameters

NameDescription
rootsArray of polynomial roots

Returns

Monic polynomial coefficients whose roots are the given values

Examples

Try It
>> poly([1, -1])
[1, 0, -1]  (x² - 1, roots at ±1)