필터 지우기
필터 지우기

shortest vector between two line segments

조회 수: 2 (최근 30일)
Tyler
Tyler 2014년 3월 13일
편집: Roger Stafford 2014년 3월 13일
Hi, im looking to find the shortest vector between two line segments.
The purpose is that i generate two line segments in space, and then i want to move one toward the other in the shortest distance possible. I have seen some existing matlab codes that provide the shortest distance between line segments - but in this case i need direction as well.
any help would be greatly appreciated!
  댓글 수: 1
Roger Stafford
Roger Stafford 2014년 3월 13일
편집: Roger Stafford 2014년 3월 13일
When you say "the shortest vector between two line segments", do you mean that the ends of a connecting vector must lie within the bounds of each of the respective line segments, or can it end on linear extensions of each line segment? I ask this because finding the former takes more processing than the latter, there being a comparatively simple formula for the shortest vector between two infinitely long straight lines.

댓글을 달려면 로그인하십시오.

답변 (1개)

John D'Errico
John D'Errico 2014년 3월 13일
Any code that can find the shortest distance between the segments must also implicitly know the points of interest on each segment. Subtracting those two points gives the vector you need.

카테고리

Help CenterFile Exchange에서 Construction에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by