MathGroup Archive 2008

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

Search the Archive

Re: can't translate 3D model to 0,0,0


On May 3, 11:17 am, will parr <willpower... at hotmail.com> 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?
>
> best wishes,
>
> Will

If a is a list of coordinates the code you posted seems fine:

a = {{a11, a12, a13}, {a21, a22, a23}, {a31, a32, a33}, {a41,
a42,a43}};
ma = Mean@a;
ac = # + ({0, 0, 0} - ma) & /@ a;
In[4]:= Mean@ac
Out[4]= {0, 0, 0}   .... as expected


  • Prev by Date: Re: can't translate 3D model to 0,0,0
  • Next by Date: Re: Fit data with range
  • Previous by thread: Re: can't translate 3D model to 0,0,0
  • Next by thread: Re: can't translate 3D model to 0,0,0