Re: can't translate 3D model to 0,0,0
- To: mathgroup at smc.vnet.net
- Subject: [mg88401] Re: can't translate 3D model to 0,0,0
- From: "David Park" <djmpark at comcast.net>
- Date: Mon, 5 May 2008 06:08:08 -0400 (EDT)
- References: <fvhe4g$3v9$1@smc.vnet.net>
It should work but you can use a slightly simpler expression. Of course, it always helps when posting to MathGroup to give an actual case that doesn't work rather than letting the responders make up their own cases. pts = RandomReal[{0, 1}, {10, 3}] mean = Mean[pts] # - mean & /@ pts Mean[%] // Chop -- David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ "will parr" <willpowers69 at hotmail.com> wrote in message news:fvhe4g$3v9$1 at smc.vnet.net... > Dear Math Forum, > > I have a problem with translating some 3D models to 0,0,0. I have been > using the following code: > > ma = Mean@a; ac = # + ({0, 0, 0} - ma) & /@ a; > > where "a" is a 3D model made up of many 3D coordinates. However, this code > does not work - in that the new centroid (mean) of the model is not at > 0,0,0. can anyone suggest an alternative method? > > best wishes, > > Will >