Least Squared Best Double Fit Least Squares Best Fit Methods are well known for a point, a straight line, a circle, a conic section, in general: for a _simple_ figure. I've programmed several of these methods myself: http://hdebruijn.soo.dto.tudelft.nl/www/programs/delphi.htm#BFC But that's not really cool. I'd rather have a least squares best fit method with _complicated_ figures, for example: two points, crossing or parallel lines, a bunch of circles, the image of a character 'A', my ultimate dream being the least squares best fit with an idealized treble clef :-) So far so good about dreams. But one has to start somewhere .. Let's consider the most simple case in two dimensions: a least squares best fit with TWO points instead of one. Writing the minimum principle for this case is not too difficult. Let the function M to be minimized be defined by M(a,b,p,q) = Sum_k [ (x_k - a)^2 + (y_k - b)^2 ].[ (x_k - p)^2 + (y_k - q)^2 ] Here the (x_k,y_k) are the fixed points of a cloud in the plane and we are satisfied if we can find some fairly unique points (a,b) and (p,q). A procedure to accomplish this is rather straigtforward. Differentiate the above Sum_k to (a,b,p,q) and put the four outcomes of this partial differentiations equal to zero. Then employ a four dimensional Newton- Rhapson iteration procedure in order to find the zeroes. It turns out that, given some neatly chosen conditions - one always can arrange this with a snippet of _purified_ applied mathematics - iterations converge very quickly to the desired result. The whole thing is published as a couple of web items at: http://hdebruijn.soo.dto.tudelft.nl/jaar2008/index.htm Any fresh ideas to accomplish more of this are quite welcome ! Han de Bruijn