function [w]=rotacioninstantanea(a1,a2,re1,re2,re3)
r=[re1 re2 re3]
b1=[0 cos(a1) sin(a1)*sin(a2); 0 sin(a1) -cos(a1)*sin(a2); 1 0 cos(a2)]
w=b1*r'
endfunction
Ejemplo con Scilab
-->function [w]=rotacioninstantanea(a1,a2,re1,re2,re3)
-->r=[re1 re2 re3]
-->b1=[0 cos(a1) sin(a1)*sin(a2); 0 sin(a1) -cos(a1)*sin(a2); 1 0 cos(a2)]
-->w=b1*r'
-->endfunction
-->rotacioninstantanea(%pi/2,%pi/4,2,2,1.4142136)
ans =
1.
2.
3.