Re: can't translate 3D model to 0,0,0
- To: mathgroup at smc.vnet.net
- Subject: [mg88420] Re: can't translate 3D model to 0,0,0
- From: Szabolcs Horvát <szhorvat at gmail.com>
- Date: Mon, 5 May 2008 06:11:33 -0400 (EDT)
- Organization: University of Bergen
- References: <fvhe4g$3v9$1@smc.vnet.net>
will parr wrote: > 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? > What does 'a' contain exactly? In[1]:= a = RandomReal[1, {100, 3}]; In[2]:= ma = Mean[a]; In[3]:= Mean[# - ma & /@ a] Out[3]= {-1.55431*10^-17, -6.66134*10^-18, 4.44089*10^-18} I get {0,0,0} for the mean (as expected).