Distance Between Two Triangles
Version 1.0.1 (1.29 KB) by
Ayad Al-Rumaithi
Finds the shortest distance between two triangles in 3d space.
This function finds the shortest distance between two triangles in 3d space using nonlinear constrained optimization.
function d=Distance2Triangles(va1,va2,va3,vb1,vb2,vb3)
where:
va1 is (3*1) coordinate vector for the first vertex of triangle a.
va2 is (3*1) coordinate vector for the second vertex of triangle a.
va3 is (3*1) coordinate vector for the third vertex of triangle a.
vb1 is (3*1) coordinate vector for the first vertex of triangle b.
vb2 is (3*1) coordinate vector for the second vertex of triangle b.
vb3 is (3*1) coordinate vector for the third vertex of triangle b.
d is the shortest distance between triangle a and triangle b.
Cite As
Ayad Al-Rumaithi (2026). Distance Between Two Triangles (https://uk.mathworks.com/matlabcentral/fileexchange/123620-distance-between-two-triangles), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2017b
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
