/** @file  psPolynomialUtils.h
 *
 * extra psPolynomial-related functions
 */

# ifndef PS_POLY_UTILS_H
# define PS_POLY_UTILS_H

// perform vector clip-fit based on significance of deviations
psPolynomial4D *psVectorChiClipFitPolynomial4D(
    psPolynomial4D *poly,
    psStats *stats,
    const psVector *mask,
    psMaskType maskValue,
    const psVector *f,
    const psVector *fErr,
    const psVector *x,
    const psVector *y,
    const psVector *z,
    const psVector *t);

// fit a 2D 2nd order polynomial to the 9 pixels centered on (x,y)
psPolynomial2D *psImageBicubeFit (psImage *image, int x, int y);

// detemine the min(max) of the special 2D 2nd order polynomial
psPlane psImageBicubeMin (psPolynomial2D *poly);

# endif /* PS_POLY_UTILS_H */
