- #1
lemonCBI
- 2
- 0
I need to determine the distance between a point and a plane segment. I have 1 point in space and 3 points which form a triangula plane segment. I know the 3 points are not colinear and the 4th point is not coplanar with the others. I want to calculate the distance between the point and the triangular plane segment described by the other 3 points.
My initial idea is to assume the plane is infinite and find the distance. I would then determine if the closest point in the plane lay within the triangle (but was not sure how I was going to do that). If it was then I was done. If not, then I would find which of the 3 line segements of the triangle lay closest to the point in the plane and use Pythagoras to figure out the distance between my original point in space and the triangle.
Any advice about this or any other method would be greatly appreciated. Also, I am performing these calculations in MATLAB so any suggestion on how to optimize my code would be very helpful as well. Thanks!
My initial idea is to assume the plane is infinite and find the distance. I would then determine if the closest point in the plane lay within the triangle (but was not sure how I was going to do that). If it was then I was done. If not, then I would find which of the 3 line segements of the triangle lay closest to the point in the plane and use Pythagoras to figure out the distance between my original point in space and the triangle.
Any advice about this or any other method would be greatly appreciated. Also, I am performing these calculations in MATLAB so any suggestion on how to optimize my code would be very helpful as well. Thanks!