Distance between a point and a triangle in 3D
by Gwendolyn Fischer
02 Feb 2009
(Updated 14 Oct 2010)
pointTriangleDistance calculates the distance between a point and a triangle in 3D.
|
Watch this File
|
| File Information |
| Description |
Calculate the distance of a given point P from a triangle TRI.
Point P is a row vector of the form 1x3. The triangle is a matrix
formed by three rows of points TRI = [P1;P2;P3] each of size 1x3.
dist = pointTriangleDistance(TRI,P) returns the distance of the point P to the triangle TRI.
[dist,PP0] = pointTriangleDistance(TRI,P) additionally returns the closest point PP0 to P on the triangle TRI. |
| MATLAB release |
MATLAB 7.0.4 (R14SP2)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 13 Aug 2009 |
Fixed a Bug spotted by Jorge Riera |
| 13 Oct 2010 |
Bug Fix because of typo. Thanks to Gordon. |
| 14 Oct 2010 |
Bug Fix due to yet another typo. |
|
Contact us at files@mathworks.com