function z = gen_rand(mu, N, sigma, num_of_gauss)

    % number of features
    %
    feats = 2;
    
    % angle between the adjacent distributions
    %
    angle = 180 / num_of_gauss;
    
    % index counter
    %
    ind1 = 1;
    ind2 = N;
    
    % zero vectors
    %
    z = zeros (N * num_of_gauss, feats);
    R = chol(sigma);
    
    % generate samples
    %
    for i = 1:num_of_gauss
        % generate the samples
        %
        v = repmat(mu, N, 1) + randn(N, 2)*R;
        z(ind1:ind2, :) = v;

        ind1 = ind1 + N;
        ind2 = ind2 + N;
        mu = rot_cc(mu, 36);

    end
end