function Q = P2quat(P)
Q(1) = P(1,1)-P(2,2);
Q(2) = P(1,2)+P(2,1);
Q(3) = P(3,1)+P(4,2);
Q(4) = P(4,1)-P(3,2);