user1641496
user1641496

Reputation: 457

closest point to set of surfaces

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

Answers (1)

Andrey Rubshtein
Andrey Rubshtein

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:

  1. Exhaustive search - Slow, but when it is feasible, it always works.
  2. Some kind of non-linear optimization method, like 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

Related Questions