From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Fit a linear function of two angles
Date: Mon, 30 Apr 2012 15:15:07 +0000 (UTC)
Organization: Xoran Technologies
Lines: 20
Message-ID: <jnma9r$812$>
References: <jnktmv$663$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1335798907 8226 (30 Apr 2012 15:15:07 GMT)
NNTP-Posting-Date: Mon, 30 Apr 2012 15:15:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: comp.soft-sys.matlab:766393

"Benjamin Kraus" <> wrote in message <jnktmv$663$>...
> I've got two lists of angles (in radians, ranging from -pi to pi), that have a fixed offset from each other (plus a fair bit of noise).
> angle1 = angle2+offset

Another idea. Transform this to


where A and B are unknowns constrained so that norm([A,B])=1 and 
sin(angle1-angle2) and cos(angle1-angle2) are transformations of the data.
You can least squares solve this problem using

and then extract the desired offset using