MathGroup Archive 1996

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: The farthest apart points problem

  • To: mathgroup at
  • Subject: [mg4679] Re: The farthest apart points problem
  • From: peter at (unk)
  • Date: Thu, 22 Aug 1996 03:55:29 -0400
  • Organization: Your Organization
  • Sender: owner-wri-mathgroup at

In article <4t6b17$7d3 at>, rigon at says...
>Let us have n points in a plane being the vertices
>of a convex hull. 
>Do you know a fast and simple algorithm to
>determine which pairs is separated by the largest
>distance ?
>Thank you in advance for any help,
A neat way of doing what you want is to use Outer.
I works with ver 2.2.3
do this:
dist1[aa_,bb_]=Sqrt[(aa-bb).(aa-bb)]; (*arbitrary dimension distance func. *)

b={{1,1,1},{3,3,3}} (*samle points*)

and finally:
you get:
{Sqrt[3], 3 Sqrt[3], Sqrt[3], Sqrt[11], Sqrt[3], Sqrt[11], Sqrt[3], Sqrt[11]}

i.e. the distance between of all combinations of the two sets of points a,b
in your case a = b should be a list of the points in the polygon.
To find the max of the distances just do Max[%//N]
The two last aguments (level specifications) in Outer I have seen documented 
only in
Mathematica Journal vol 6 issue 3 you can also look in MJ vol 1 issue 1, I 
think the last
ref. uses a trick to avoid the level specefication that vas not available in 
early MaMa versions
/Peter W
e-mail peter at


  • Prev by Date: Re: 13 is not prime!
  • Next by Date: Re: mm as a calc tutor????
  • Previous by thread: Re: The farthest apart points problem
  • Next by thread: The minimum spanning circle problem