solveCubic function

(int, Mat) solveCubic(
  1. InputArray coeffs, {
  2. OutputArray? roots,
})

SolveCubic finds the real roots of a cubic equation.

For further details, please see: https://docs.opencv.org/master/d2/de8/group__core__array.html#ga1c3b0b925b085b6e96931ee309e6a1da

Implementation

(int rval, Mat roots) solveCubic(InputArray coeffs, {OutputArray? roots}) {
  roots ??= Mat.empty();
  final p = calloc<ffi.Int>();
  cvRun(() => ccore.cv_solveCubic(coeffs.ref, roots!.ref, p, ffi.nullptr));
  final rval = p.value;
  return (rval, roots);
}