Reputation: 457
I have these surfaces defined by their position in space (x, y, z). Ideally, they should intersect but it is not always the case. However, there should be a point that has the shortest Ecludian distance from all the surfaces. I do not have analytical expressions for my surfaces. How would I find this point rather than going through all the possible candidates, which could be thousands?
Upvotes: 1
Views: 765
Reputation: 20915
In case you know the mathematical equations behind those surfaces, I'd recommend finding the closest point by formulating a least squares problem and solving analytically.
If you don't know anything about those surfaces, you should try either:
fminsearch
. If those meshes have enough points, you can simply find the closest point. If not, you should do some kind of interpolation as well. If you have some starting point, supply it to the algorithm. Upvotes: 1