Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Find instant axis of rotation
Date: Wed, 28 Oct 2009 22:54:02 +0000 (UTC)
Organization: KTH
Lines: 32
Message-ID: <hcai2a$dmb$1@fred.mathworks.com>
References: <hc7mhj$69k$1@fred.mathworks.com> <hc8r78$em6$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 1256770442 14027 172.30.248.37 (28 Oct 2009 22:54:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 28 Oct 2009 22:54:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1282592
Xref: news.mathworks.com comp.soft-sys.matlab:580795


Thank you both for your suggestions,

I did some work with based on that pdf that was posted (mainly because I have very limited experience of vector fields).

It seems like I can successfully calculate the direction of the axis (eq 8 in pdf). But I have problems getting the translation of the axis correct (eq 10). 

I've tried with many different motions/data points but always get more or less the same translation (but different directions).

Here is my code with two example points (I've also have tried increased accuracy on the data points with out success).

Once again, I would be very grateful for all comments/suggestions!

Thanks!

%points before
p0=[-199.177	399.997	172.887]';
q0 = [-199.177	-400.003	172.872]';
r0 = [-2479.583	244.996	225.422]';
%points after
p1 = [-199.056	399.997	172.048]';
q1 = [-199.056	-400.003	172.034]';
r1 = [-2479.425	244.996	226.179]';
% % 

w = cross(((q1-q0)-(r1-r0)),((p1-p0)-(r1-r0)))/dot(((q1-q0)-(r1-r0)),((p1+p0)-(r1+r0))); %Calculates rotation vector

rot_angle = norm(w) %this is tan(theta/2) where theta is actuall rot angle (this 
angle matches really well with data output)

w=w/norm(w); %normalizes rotation axis for further calculations

p = 0.5*((cross(w,(p1-p0))/rot_angle)-(dot(w,p1+p0).*w+p0+p1)); %This is where something goes wrong