Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to solve TA = BT
Date: Mon, 19 Jan 2009 16:27:01 +0000 (UTC)
Organization: Xoran Technologies
Lines: 26
Message-ID: <gl29kl$qn5$1@fred.mathworks.com>
References: <gkkqeh$idk$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1232382421 27365 172.30.248.37 (19 Jan 2009 16:27:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 19 Jan 2009 16:27:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: news.mathworks.com comp.soft-sys.matlab:512500


"Pinpress" <nospam__@yahoo.com> wrote in message <gkkqeh$idk$1@fred.mathworks.com>...
> Hi all,
> 
> I wonder if there is an existing program that solves the matrix equation: TA = BT, in which T is to be solved, all matrices (T, A, B) are 4-by-4 matrices.  In addition, it is prior information that all matrices are rigid-body transformation matrices, so T only has 12 unknowns. 
---------------------------------------

Actually, it has 6, if you parametrize T in terms of 3 Euler angles and 3 translations...


---------------------------------
> Please also note that I have many equations similar to the one given, so:
> 
> T*A1 = B1*T;
> T*A2 = B2*T; 
> ...
> T*An = Bn*T;
> 
> In all of the equations, T should be the same. So my question is, how to solve T? thanks for any input. 
--------------------------------

In addition to what Roger said, T has 6 degrees of freedom, so if n>6, it is likely that the above system of equations will be overdetermined. So, I'm assuming that what you want is some sort of least squares solution

(1)  min.  sum_i || T*Ai-Bi*T ||^2   

If you parameterized T in terms of angles and translations, you could solve this using fmincon(), althrough you would want a good initial guess of T as insurance against local minima.