function [S] = project(Q,normalize)
%Returns the matrix S: 210 parameters -> 12 types
%from a matrix Q with lines already reordered by type of parameter.
if nargin<2, normalize = 1; end;
[m,n] = size(Q);
N = (m+6)/12;
S = zeros(12,n);
for i = 1:n,
a = Q(:,i);
b = reshape(a(6*N+1:m), N-1,6);
b = [b;zeros(1,6)];
a = [a(1:6*N);reshape(b,N*6,1)];
a = reshape(a,N,12);
h = sum(abs(a),1); %h(1) is buckle, h(2) is propeller,.., h(12) is rise.
S(:,i) = h;
end;
%Normalize
if normalize==1,
T = ones(6,n);
T = [N*T; (N-1)*T];
S = S./T;
end;