Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

function checkr(R)

fprintf('checking rotation matrix...\n');


fprintf('checking orthogonality...\n');
a=det(R);
fprintf('determinant of R=%g\n',a);
c=['u' 'v' 'w'];
for i=1:3
b=transpose(R(:,i))*R(:,i);
fprintf('%c squared=%g\n',c(i),b);
end
for i=1:3
j=i+1;
if (j==4) j=1;
end;
b=transpose(R(:,i))*R(:,j);
fprintf('%c transposes into %c=%g\n',c(i),c(j),b);
end
for i=1:3
j=i+1;
k=i-1;
if (k==0) k=3;
end;
if (j==4) j=1;
end;
fprintf('%c cross %c=\n',c(i),c(j));
cross(transpose(R(:,i)),R(:,j))
R(:,k)
end

You might also like