Find the closest distance between two lines segments?

  • Context: Undergrad 
  • Thread starter Thread starter kolleamm
  • Start date Start date
  • Tags Tags
    Lines
Click For Summary
SUMMARY

To find the smallest distance between two line segments, one must establish a distance function based on the positions along the segments, utilizing two variables. The process involves calculating the derivative of this function to identify critical points, which may indicate minima. Additionally, evaluating the endpoints of the segments is crucial, as they may yield the minimum distance without being local minima. This method can be simplified if the line segments are straight lines.

PREREQUISITES
  • Understanding of calculus, specifically derivatives and critical points
  • Familiarity with geometric concepts of line segments
  • Knowledge of distance functions in a two-dimensional space
  • Basic proficiency in mathematical optimization techniques
NEXT STEPS
  • Research methods for calculating distance between geometric shapes
  • Learn about optimization techniques in calculus
  • Explore the implications of using derivatives to find minima
  • Investigate algorithms for geometric intersection and distance calculations
USEFUL FOR

Mathematicians, computer graphics developers, and anyone involved in computational geometry or optimization problems related to distance calculations between geometric entities.

kolleamm
Messages
476
Reaction score
44
TL;DR
Find the smallest distance between two line segments
If I have two line segments, how can I find the smallest distance between them? Any one point on each of the segments can be chosen for comparison. (to go a step further, a circle's outer edge and a line segment)

Thanks in advance.
 
Physics news on Phys.org
The most general approach for continuous lines: Set up the distance as function of the positions along the lines (with two variables), look for zeros in the derivative to look for minima, then check the end points because they might be the actual solution without being a local minimum in your variables.

If you have some knowledge about these line segments (e.g. straight lines) things can get much easier.
 
  • Like
Likes   Reactions: kolleamm

Similar threads

  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 40 ·
2
Replies
40
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K