Polynomial.FromRoots Method

Definition

Namespace: Numerics.NET.Curves
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4

Overload List

FromRoots(Double[]) Constructs a new polynomial that has the specified roots.
FromRoots(ReadOnlySpan<Double>) Constructs a new polynomial that has the specified roots.

FromRoots(Double[])

Constructs a new polynomial that has the specified roots.
C#
public static Polynomial FromRoots(
	params double[] roots
)

Parameters

roots  Double[]
A list of roots.

Return Value

Polynomial
A polynomial with the specified roots.

Remarks

The degree of the polynomial is equal to the number of roots. You can specify the same root multiple times.

Exceptions

ArgumentNullException

roots is null.

FromRoots(ReadOnlySpan<Double>)

Constructs a new polynomial that has the specified roots.
C#
public static Polynomial FromRoots(
	ReadOnlySpan<double> roots
)

Parameters

roots  ReadOnlySpan<Double>
A span of roots.

Return Value

Polynomial
A polynomial with the specified roots.

Remarks

The degree of the polynomial is equal to the number of roots. You can specify the same root multiple times.

Exceptions

ArgumentNullException

roots is null.

See Also