MathGroup Archive 2007

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

Search the Archive

Re: finding a rotation vector

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79616] Re: finding a rotation vector
  • From: Ray Koopman <koopman at sfu.ca>
  • Date: Tue, 31 Jul 2007 06:10:39 -0400 (EDT)
  • References: <f8kfbg$169$1@smc.vnet.net>

On Jul 30, 3:42 am, william <willpower... at hotmail.com> wrote:
> Hi there,
>
> I have a problem in mathematica concerning 2 non geometric shapes:
>
> 1 the shapes are made up of collections of points in 3D space.
>
> 2 the shapes the not mathematically exactly the same (the points are not homologous), but they are very similar.
>
> 3 shape 2 is effectively shape 1 that has been translated (ie its centroid (mean of 3D coordinates) has been moved) and rotated in 3D space.
>
> I can find the translation vector (centroid 1-2), but cannot find the rotation vector. I was thinking along the lines of: least squares registering shape 2 to 1, and returning the rotation used in this process. I am very stuck with the process, so any help would be very much appreciated!!
>
> thanks in advance,
>
> will

If a and b are n x m matrices, n > m, this will translate
and rotate b into a least-squares approximation to a:

ma = Mean@a; ac = #-ma& /@ a;
mb = Mean@b; bc = #-mb@ /@ b;
r =  #[[3]].Transpose@#[[1]]& @
     SingularValueDecomposition[Transpose at ac.bc];
ahat = #+ma& /@ (bc.r)



  • Prev by Date: Re: Re: StackGraphics[] absent in Mathematica 6.0?
  • Next by Date: Re: Re: Where is the Navigate menu item in Workbench
  • Previous by thread: finding a rotation vector
  • Next by thread: Slightly OT: Telos Mathematica Books