# Fitting 2D mapping data from multiple measurements

Given a set of points in a plane, and series of measurements of the distances between those points, how would I go about generating a best-fit model of the position of the points?

For example, given 3 points (A, B, C) that define a 30-40-50 right triangle, the data set might look something like this:

(0, 29.1, 39.7) - at point A, measuring to B, C
(NULL, 0, 49.4) - at point B, missing measurement to A
(40.4, 50.5, 0) - at point C, measuring to A, B

What I would like to do is fit this data to a model that will make it possible to determine the distance between any two arbitrary data points, as well as determine the error (given a known error in each measurement). I'm not even sure what type of problem this is, so any pointers to methods or algorithms would be greatly appreciated.

If you know that you have $n$ points $X_1,...,X_n$ and the desired pairwise distances $d_{ij}$ between $X_i$ and $X_j$ you could try and optimize the functional $$\sum_{i<j} (d_{ij}-|X_i-X_j|)^2$$
Of course, you could use a $p$-norm in stead of the $2$-norm above. For $p$ large it will try to minimize the largest error.