Package org.ddogleg.solver
Class FitQuadratic1D
java.lang.Object
org.ddogleg.solver.FitQuadratic1D
Fits the coefficients for a quadratic polynomial to a set of even spaced data in an array.
y = a*x2 + b*x + c
The coefficients (a,b,c) of the polynomial are found the solving a system of linear equations that minimizes the least squares error.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble[]
boolean
process
(int offset, int length, double... data) Computes polynomial coefficients for the given data.
-
Constructor Details
-
FitQuadratic1D
public FitQuadratic1D()
-
-
Method Details
-
process
public boolean process(int offset, int length, double... data) Computes polynomial coefficients for the given data.- Parameters:
length
- Number of elements in data with relevant data.data
- Set of observation data.- Returns:
- true if successful or false if it fails.
-
getCoefficients
public double[] getCoefficients()- Returns:
- The coefficients [a,b,c]
-