[R] off-topic: affine transformation matrix

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue May 29 00:18:51 CEST 2007


Isn't this just a regression (hopefully with a near-zero error).

coef(lm(cbind(xnew, ynew) ~ xold + yold))

should do what I think you are asking for.  (I am not clear which 
direction you want the transformation, so choose 'old' and 'new' 
accordingly.)

On Mon, 28 May 2007, Dylan Beaudette wrote:

> This may sound like a very naive question, but...
>
> give two lists of coordinate pairs (x,y - Cartesian space) is there any 
> simple way to compute the affine transformation matrix in R.
>
> I have a set of data which is offset from where i know it should be. I have
> coordinates of the current data, and matching coordinates of where the data
> should be. I need to compute the composition of the affine transformation
> matrix, so that I can apply an affine transform the entire dataset.
>
> any ideas?
>
> thanks in advance!
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list