Re: Problem: Smallest sphere including all 3D points
- To: mathgroup at smc.vnet.net
- Subject: [mg16556] Re: [mg16471] Problem: Smallest sphere including all 3D points
- From: Jurgen Tischer <jtischer at col2.telecom.com.co>
- Date: Tue, 16 Mar 1999 04:00:25 -0500
- Organization: Universidad del Valle
- References: <199903130722.CAA24556@smc.vnet.net.>
- Sender: owner-wri-mathgroup at wolfram.com
Luc, use the force, in this case minimum squares: If li is your list of points, then smallestSphere[li_] := Module[{x, y, z, r}, {x, y, z} = {x, y, z} /. First[Solve[(D[Plus @@ (With[{a = #1 - {x, y, z}}, a . a] & ) /@ li, #1] & ) /@ {x, y, z} == 0]]; r = Max[(With[{a = #1 - {x, y, z}}, Sqrt[a . a]] & ) /@ li]; {{x, y, z}, r}] Jurgen "Barthelet, Luc" wrote: > > > I was just asked by a friend how to find the smallest sphere that > would include all points from a set of 3D points. > It feels like finding a 3D convex hull and then finding the best sphere (??) > I would appreciate any complete solution or best set of pointers... > > Thank you, > > Luc Barthelet > General manager, Maxis > http://www.simcity.com <http://www.simcity.com> (we are > #1!) > >
- References:
- Problem: Smallest sphere including all 3D points
- From: "Barthelet, Luc" <lucb@ea.com>
- Problem: Smallest sphere including all 3D points