theta = [0:0.1:2 * pi];
%rand( 70, 1) * 2 * pi;

S2 = 0.25 * (rand( 30, 2 ) -0.5 );


S = 1 * [ (1 +0.1 .* sin(4*theta') ) .* cos(theta'), (1 +0.1 .* sin(4*theta' ) ) .* sin(theta') ];
%S = 1 * [ cos(theta'), sin(theta') ];

S2 =  1+ [ cos(theta'), sin(theta') ];

% remove first and last point from S
S = S( 4:size(S,1)-2, : );

% remove the middle points of S2
S2 = [S2( 1:floor(size(S2,1)/2-1), : );
      S2( floor(size(S2,1)/2 +4):size(S2,1), : ) ];



S3 = [ S; S2 ];


[clusterLabels] = ngcluster( S3, 2, 0.07);
