#!/usr/bin/octave

x=17;

####
#### helper functions
####

function results = randAngles(n)
	results = pi*(2*rand(n,1)-1);
endfunction

####
#### experimentation with SO(3)
####

## skew symmetric basis

Ex = [ 0  0  0
			 0  0 -1
			 0  1  0];

Ey = [ 0  0  1
		   0  0  0
			-1  0  0];

Ez = [ 0 -1  0
		   1  0  0
			 0  0  0];

rx = randAngles(1);
ry = randAngles(1);
rz = randAngles(1);

C = rx*Ex+ry*Ey+rz*Ez;
R = expm(C);
Cp = real(logm(R));

rxp = trace(Cp*Ex);
ryp = trace(Cp*Ey);
rzp = trace(Cp*Ez);

rx, rxp
ry, ryp
rz, rzp
