Distance Between Two Line Segments

Finds the shortest distance between two line segments in 3d space.
8 Downloads
Aktualisiert 12. Sep 2023

Lizenz anzeigen

These functions find the shortest distance between two line segments in 3d space using analytic expression and nonlinear constrained optimization.
function d=Distance2LinesA(va1,va2,vb1,vb2): finds the distance using analytic expression based on the equations in: https://stackoverflow.com/a/67102941
function d=Distance2LinesN(va1,va2,vb1,vb2): finds the distance using nonlinear constrained optimization.
where:
va1 is (3*1) coordinate vector for the first point of line segment a.
va2 is (3*1) coordinate vector for the second point of line segment a.
vb1 is (3*1) coordinate vector for the first point of line segment b.
vb2 is (3*1) coordinate vector for the second point of line segment b.
d is the shortest distance between line segment a and line segment b.

Zitieren als

Ayad Al-Rumaithi (2024). Distance Between Two Line Segments (https://www.mathworks.com/matlabcentral/fileexchange/123600-distance-between-two-line-segments), MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R2017b
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Tags Tags hinzufügen

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Veröffentlicht Versionshinweise
1.0.2

description

1.0.1

added analytic expression

1.0.0