computeExtremaAngles = (args) => {
    /** @type {import('@tensorflow/tfjs').TensorInfo} */
    const { histograms } = args.inputs;
    /** @type {import('@tensorflow/tfjs-backend-cpu').MathBackendCPU} */
    const backend = args.backend;

    /** @type {TypedArray} */
    const histogramValues ={values: backend.data.get(histograms.dataId).values,width:histograms.shape[1],height:histograms.shape[0]};

    const resultValues = computeExtremaAnglesImpl(histogramValues);

    return backend.makeOutput(resultValues, [histograms.shape[0]], histograms.dtype);
}
Fit a quatratic to 3 points. The system of equations is:

y0 = A*x0^2 + B*x0 + C
y1 = A*x1^2 + B*x1 + C
y2 = A*x2^2 + B*x2 + C

This system of equations is solved for A,B,C.