Skip to content

solvePoly

Core and matricesfunctionOpenCV 5.0.0
import { solvePoly } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTScoeffs, roots, maxIters
FUNCTIONsolvePoly
RETURN TYPEnumber
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Finds the real or complex roots of a polynomial equation.

The function cv::solvePoly finds real and complex roots of a polynomial equation:

\texttt{coeffs} [n] x^{n} +  \texttt{coeffs} [n-1] x^{n-1} + ... +  \texttt{coeffs} [1] x +  \texttt{coeffs} [0] = 0
solvePoly(coeffs: Mat, roots: Mat, maxIters: number): number;
2 available overloads
solvePoly(coeffs: Mat, roots: Mat): number;
solvePoly(coeffs: Mat, roots: Mat, maxIters: number): number;
coeffs

array of polynomial coefficients.

roots

Output destination, filled by the native operation. output (complex) array of roots.

maxIters

maximum number of iterations the algorithm does.

Returns

The number result.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.