3
$\begingroup$

I have object in 3d space created from points $P_i(x, y, z)$ from which I can create triangles, and I need to calulate distance from point X to this object.

I try to take 3 points from smallest distance and calulate height of tetrahedron created from this 3 points and X, but this will be not the distance from the object.

So my question is how to calculate this distance.

  • 0
    There are several problems here. Is it true that object constructed from points $P_i$ is convex? Can you say something special about location of points $P_i$? Can you ensure that $X$ is not in convex hull of points $P_i$? How fast calculation should be?2012-05-11
  • 0
    Yes it's a convex hull. Point X is outside and not the part of convex. I just need solution that will work.2012-05-11
  • 0
    If you need a code here is snippet in C that calculate distance to triangle http://iquilezles.org/www/articles/triangledistance/triangledistance.htm2017-09-07

2 Answers 2