MathGroup Archive 2004

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

Search the Archive

Re: Smalest enclosing circle

  • To: mathgroup at smc.vnet.net
  • Subject: [mg50089] Re: Smalest enclosing circle
  • From: koopman at sfu.ca (Ray Koopman)
  • Date: Sat, 14 Aug 2004 01:51:01 -0400 (EDT)
  • References: <cfi8tm$4p6$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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?

My previous code was wrong.

In[1]:= xy = (* same data as before *)
        {{0.6387508898625163, 0.8718650185783614}, 
         {0.08644342251607252, 0.3294838833708168}, 
         {0.1870358394343342, 0.8811055141368236}, 
         {0.3192979185986885, 0.3170715387504082}, 
         {0.438136771215097, 0.5319294143363852}, 
         {0.9179114087251881, 0.6613289334430387}, 
         {0.7341832395247138, 0.8830590740761859}, 
         {0.9834132497013177, 0.7008775400319166}, 
         {0.196695901661286, 0.6117008688670413}, 
         {0.10315109572363866, 0.0506140728297785}};

In[2]:= Clear[u,v]; 
        {r,uvrule} = FindMinimum[Max[Norm[#-{u,v}]&/@xy],
                     {u,First@Mean@xy,First@Median@xy},
                     {v, Last@Mean@xy, Last@Median@xy}]
Out[2]= {0.60531, {u -> 0.389513, v -> 0.583904}}


  • Prev by Date: Re: Smallest enclosing circle
  • Next by Date: Re: Smalest enclosing circle
  • Previous by thread: Re: Re: Smallest enclosing circle
  • Next by thread: Re: Re: Smalest enclosing circle