From: John_old Craighead on
Roger's message (below) mentions "It can be shown, 1) that the trace of A must equal 1+2*cos(theta) where theta is the counterclockwise angle of rotation, ...". I'm hoping that smeone can share how to show this with either linear albegra, Lie Theory or both. Thanks, John.

"Roger Stafford" <ellieandrogerxyzzy(a)mindspring.com.invalid> wrote in message <fk0cpd$g0v$1(a)fred.mathworks.com>...
> "Pinpress " <nospam__(a)yahoo.com> wrote in message <fjvbqk$gbt
> $1(a)fred.mathworks.com>...
> > Hi,
> >
> > Any one knows how to extract the rotational axis and the
> > angle from a 3-by-3 rotation matrix? Thanks very much.
> > I've googled, but haven't got the luck for the solution.
> -------
> If matrix A is a 3 x 3 rotation matrix about the origin, then it must be a real
> orthogonal (unitary) matrix (that is, its transpose must be equal to its
> inverse), and its determinant must equal +1. Since any point on the axis of
> rotation obviously remains fixed, a unit vector along this axis must
> necessarily be an eigenvector of A with eigenvalue 1, and there clearly can be
> no other real eigenvectors or eigenvalues. Hence, we can determine the axis
> of rotation by selecting that unique eigenvector, w, which has an eigenvalue
> of 1. It can be shown, 1) that the trace of A must equal 1+2*cos(theta) where
> theta is the counterclockwise angle of rotation, and 2) that the dot product of
> the vector
>
> t = [A(3,2)-A(2,3),A(1,3)-A(3,1),A(2,1)-A(1,2)]
>
> with w must be 2*sin(theta), which means that sin(theta) and cos(theta) can
> be computed. We can then use matlab's 'atan2' function to determine theta
> itself from these values. Note that the signs of both w and theta can be
> reversed and still correspond to the same rotation matrix, so the convention
> has been adopted below that the positive value of theta will always be
> selected and the sign of w adjusted accordingly if necessary.
>
> The following then is the needed matlab computation:
>
> [V,D] = eig(A);
> [ignore,ix] = min(abs(diag(D)-1));
> w = V(:,ix);
> t = [A(3,2)-A(2,3),A(1,3)-A(3,1),A(2,1)-A(1,2)];
> theta = atan2(t*w,trace(A)-1);
> if theta<0, theta = -theta; w = -w; end
>
> The quantities w and theta will be a unit vector along the rotation axis and
> the counterclockwise rotation about it, respectively. Note that this
> computation does not work unless A is a valid rotation matrix.
>
> Roger Stafford
>
From: Bruno Luong on
"John_old Craighead" <7jwc2(a)queensu.ca> wrote in message <hjaf4r$4ro$1(a)fred.mathworks.com>...
> Roger's message (below) mentions "It can be shown, 1) that the trace of A must equal 1+2*cos(theta) where theta is the counterclockwise angle of rotation, ...". I'm hoping that smeone can share how to show this with either linear albegra, Lie Theory or both. Thanks, John.

Here is the general idea:

Euler has showed that linear map represented by a (3 x 3) A such that A'*A has always a fixed-point:
http://en.wikipedia.org/wiki/Euler%27s_rotation_theorem#Matrix_proof

Next, in the basis that contains the fixed-axis, the matrix is reduced to

[1 0 0
0 cos -sin
0 sin cos ]

The trace is then 1 + 2*cos.

Bruno
From: mrwaka2011 Walker on
"Pinpress " <nospam__(a)yahoo.com> wrote in message <fjvbqk$gbt$1(a)fred.mathworks.com>...
> Hi,
>
> Any one knows how to extract the rotational axis and the
> angle from a 3-by-3 rotation matrix? Thanks very much.
> I've googled, but haven't got the luck for the solution.

I am working on the attitude and orbit determination and control system on a satellite for a design competition for the Air Force. http://www.vs.afrl.af.mil/UNP/

I am given and x y and z components from an instrumental reading. I have to find the angle between those readings and the body fixed frame because the spacecraft is tumbling. I plan on using a 1-2-3 rotation matrices to find the angles. I might have to use the work you all have done and work it out three times for each axis. So if anyone has any help I will be more than happy.
Thank you.