%INVEULERTESER Tests inveuler.m % Tests inveuler.m a times % % Syntax: inveulertester(a) % % Inputs: % a - number of times to test % % Other m-files required: inveuler.m % Author: Travis Hydzik % Last revision: 19 October 2004 function inveulertester(a) for i=1:a disp('--------------------------------------------'); a = 10*rand-5; %rand number between -5 nad 5 b = 10*rand-5; c = 10*rand-5; [a b c] T = rotz(a)*roty(b)*rotz(c) [theta1, theta2] = inveuler(T); theta1 T1 = rotz(theta1(1))*roty(theta1(2))*rotz(theta1(3)) toleq(T1,T,.00000001); theta2 T2 = rotz(theta2(1))*roty(theta2(2))*rotz(theta2(3)) toleq(T2,T,.00000001); end