View Single Post

  #5 (permalink)  
Old 03-05-2006
Winwaed's Avatar
Winwaed Winwaed is offline
Mapping-Tools.com
Black Belt
 
Join Date: Feb 2004
Posts: 1,142
Blog Entries: 22
There might be a geometric solution, but the errors in the input data make it difficult.

I would be tempted to approach the problem with a Simplex Algorithm ("Numeric Recipes in C" has the code, and Sedgwick probably does as well).
Basically, set up a function, which takes a test location as the input, and returns an error.
One possible way of calculating the error:

Measure each distance from the test location to the circle centres.
Then calculate the sum-square of (measured distance - circle radius).
Return square root of this sum, as the error.

Then setup the Simplex algorithm to work in two dimensions and to minimize this error value.
Starting seed coordinates (you'll need three in a triangle) should be somewhere near the centroid of the input data points.

Coding the Simplex algorithm up is quite involved - too much to post here, and probably off topic. If you think you're up to it, I could dig up the book references (both books are good books to have on the shelf anyway).

Also I'm not sure what the speed would be like with VB6 calling MapPoint. Simplex is an iterative algorithm - progressively finding better solutions. As such it is VERY good - far,far better than a brute force search, but it would be difficult to know if it will be too slow or not until you try it.

As an alternative, I initially thought of it as a Linear Programming Problem. If possible, this would be much quicker. However, you need to represent a "measure distance" function as a linear function, I don't think this is possible.


Richard
__________________
Winwaed Software Technology LLC
http://www.winwaed.com
See http://www.mapping-tools.com for MapPoint Tools
See the Geoweb Guru for online mapping
Reply With Quote