Function reference · Solving

roots

Returns legacy-style polynomial roots as a Vector.

roots(expression[, variable]) provides the legacy root-return shape while using Nerdamer 2.0's polynomial solver for polynomial input. Numeric constants retain the legacy square-root behavior.

Examples

These examples use Nerdamer Notation.

Return the roots of a univariate polynomial as a Vector.

roots(x^2-1,x)

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(...).

roots(expression[, variable])

Parameters

  • expression — Univariate polynomial or numeric constant whose roots should be returned.
  • variable — Optional polynomial variable.

nerdamer.roots

Call the operation through the default nerdamer import.

nerdamer.roots(input: ExpressionInput, variable?: ExpressionInput): Vector

Parameters

NameTypeDescription
inputExpressionInput—
variableExpressionInput—

Returns

Vector

Browse the nerdamer API →

Direct JavaScript / TypeScript API

Import the operation directly from its package entry point.

import { roots } from 'nerdamer/solve';
roots(input: ExpressionInput, variable?: ExpressionInput): Vector

Parameters

NameTypeDescription
inputExpressionInput—
variableExpressionInput—

Returns

Vector

Browse nerdamer/solve →

← Back to Function reference