Subject: Re: Minimum distance between objects in 2D
Date: Tue, 13 Jan 1998 23:50:39 -0500
From: Alex Bogomolny

Dear Ad:

I am not aware of a book that evaluates distance for all the possible combinations of your shapes. But the task seems pretty simple.

I believe you can easily establish all the distances from a few formulas:

  1. Distance between two points
  2. Distance between a straight line and a point
  3. Distance between a circle and a point
  4. Distance between a circle and a straight line.

Examples (assuming the shapes do not intersect):

  1. Distance between two rectangles is the shortest distance between their vertices.
  2. Distance between an arc and a square is the shortest distance between the corresponding circle and vertices of the square and the endpoints of the arc and the vertices.

In the chapter of his book "Algorithms" devoted to Geometric algorithms, Robert Sedgewick gives a natural advice at how to sort a set of points in search of the minimal pairwise distance. Since your problem is ultimately reducible to this one, I would consider a question of sorting your points before applying the formulas.

Best regards,
Alexander Bogomolny

|Reply| |Up| |Exchange index| |Contents| |Store|

Copyright © 1996-2018 Alexander Bogomolny