% pidot.m: Function to give derivaties of body angular momentum vector, Pi.
% Date:   Tue 2-May-06
% Author: Charles P. Coleman

function Pidot = pidot(t,Pi)
global I1 I2 I3 

% Initilaize vector of derivatives
%Pidot = zeros(1,3);
Pidot = zeros(3,1);

% Body angular momentum derivatives
% Marsden and Ratiu (1993), p 6, Eq 91.2.7)
Pidot(1) = ((I2-I3)/(I2*I3))*Pi(2)*Pi(3);
Pidot(2) = ((I3-I1)/(I3*I1))*Pi(3)*Pi(1);
Pidot(3) = ((I1-I2)/(I1*I2))*Pi(1)*Pi(2);
