Mathematics: Approximation

The base class ApprQuery supports RANdom SAmple Concensus (RANSAC) for least-squares fitting. Some of the derived classes (but not all) are built to use the base-class support.
Approximate a set of points by a Gaussian distribution.
Approximate a set of points by a line. A height line in 2D is of the form y-y0 = A*(x-x0). An orthogonal line is of the form P+t*D, where P is a point on the line and D is a unit-length direction.
Approximate a set of points by a plane. A height plane in 3D is of the form z-z0 = A*(x-x0)+B*(y-y0). An orthogonal plane is of the form Dot(N,X-P) = 0, where P is a point on the plane and N is a unit-length normal.
Approximate a set of 2D points by a circle or an ellipse.
Approximate an ellipse by circular arcs. The algorithm is specific to axis-aligned ellipses in the plane. Approximate a parametric curve by circular arcs. The algorithm applies to any continuous parameterized curve in the plane.
Approximate a set of 3D points by a cone. The algorithm is described in the comments in the header file.
Approximate an elliptical cross section and additional points by a cone.
Approximate a set of 3D points by a cylinder.
Approximate a set of 3D points by a torus. The algorithm is described in the comments in the header file.
Approximate a set of points by a curve or surface that is represented implicitly by a quadratic equation X^T*A*X+B^T*X+C = 0, where A is NxN, B is Nx1, and C is a scalar (N = 2 or 3). The Nx1 vector X represents the variables. The implementation contains specialized forms when you believe the points lie on a circle or on a sphere.
Approximate a set of points by a sphere, ellipsoid, or paraboloid. The PDF reference describes the algorithm and has pseudocode.
Approximate a set of points on a sphere by a great circle or by an arc of a great circle.
Approximate a set of data of the form (x,w) by w = f(x), a set of data of the form (x,y,w) by w = f(x,y), or a set of data of the form (x,y,z,w) by w = f(x,y,z). In all cases, f is a polynomial where all coefficients are estimated by the least-squares algorithm.
Approximate a set of data of the form (x,w) by w = f(x), a set of data of the form (x,y,w) by w = f(x,y), or a set of data of the form (x,y,z,w) by w = f(x,y,z). In all cases, f is a polynomial, but the caller specifies which of the coefficients are to be estimated by the least-squares algorithm. For example, for degree 3, ApprPolynomia2 will fit (x,w) data with w = c0+c1*x+c2*x^2+c3*x^3 and estimate all coefficients c0, c1, c2, and c3. In ApprPolynomialSpecial2, the caller can specify that w = c1*x+c3*x^3, believing that c0 and c2 are both zero. The least-squares algorithm will estimate only c1 and c3.
Approximate a set of points in 2D by two parallel lines.
Fit a rectangle to a convex quadrilateral that is nearly a rectangle. The algorithm uses a least-squares formulation.