% KLASZTEREZES

% aranyok
pi1 = 0.4;
pi2 = 1-pi1;

% gausszok
m1 = [0, 0];
a1 = pi/6;
r1 = [1; 1.15]/2;
tr1 = diag(r1) * [cos(a1), sin(a1); -sin(a1), cos(a1)];

m2 = [4, 2];
a2 = 2*pi/3;
r2 = [1; 3]/2;
tr2 = diag(r2) * [cos(a2), sin(a2); -sin(a2), cos(a2)];

% mintaszam
nM = 200;
dim= 2;

x  = randn(nM,dim);
n1 = nM * pi1;
n2 = nM - n1;
x(1:n1,:)       = repmat(m1,[n1,1]) + x(1:n1,:)      * tr1;
x((n1+1):end,:) = repmat(m2,[n2,1]) + x((n1+1):end,:)* tr2;

cla; hold on; box on;
plot(x(1:n1,1),x(1:n1,2),'ro','linewidth',2);
plot(x((n1+1):end,1),x((n1+1):end,2),'k+','linewidth',2);
set(gca,'Xtick',[]); set(gca,'Ytick',[]);
print -depsc2 cluster1.eps