MathGroup Archive 2004

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

Search the Archive

Re: Smalest enclosing circle


Steve Gray <stevebg at adelphia.net> wrote in message 
news:<cfi8tm$4p6$1 at smc.vnet.net>...
> Given n points in the  plane, I want to find the smallest
> enclosing circle. Does anyone have Mathematica code to do this?

In[1]:= xy = Table[Random[],{n=10},{2}]
Out[1]= {{0.638751, 0.871865}, {0.0864434, 0.329484},
         {0.187036, 0.881106}, {0.319298, 0.317072},
         {0.438137, 0.531929}, {0.917911, 0.661329},
         {0.734183, 0.883059}, {0.983413, 0.700878},
         {0.196696, 0.611701}, {0.103151, 0.0506141}}

In[2]:= Clear[z]; FindMinimum[Max[Norm[#-z]&/@xy],
                              {z,Mean[xy],Median[xy]}]
Out[2]= {0.560158, {z -> {0.472102, 0.472102}}}


  • Prev by Date: Re: Reduce/Solve
  • Next by Date: New user: Abs[] problem
  • Previous by thread: Re: Re: Smallest enclosing circle and other model versions
  • Next by thread: Re: Smalest enclosing circle