close all; clear all;
%% Data for Agglomerates
N = 100; % number of spheres
a = 1; % lowest diameter of sphere
b = 100 ; % highest diameter of sphere
Diam = a + (b-a).*rand(N,1);
Diam = round(Diam);
aaa= 1; % minimum x and y coordinate limit for spheres
bbb= sum(Diam) ;% maximum x and y coordinat limit for sphere
M=2 ;
Axes= zeros(N,M);
Axes(:,1)=aaa+(bbb-aaa)*rand(N,1);
for k=2:M
aaa=randperm(N);
Axes(:,k)=Axes(aaa,1);
end
Axes_Label ={'X axis','Y axis'};
Data_agglo = [Diam Axes];
Data_Label ={'Diameter','X axis','Y axis'};
R = Diam ./2;
s = sum(Axes);
%% Plotting Agglomerates in 2D
f = figure('visible','on');
for i =1:1:size(Data_agglo,1)
p = linspace(-Diam(i),Diam(i),200);
[X,Y] = meshgrid(p,p); % box mesh
active = X.^2 + Y.^2 <= R(i)^2 ;
plot(Data_agglo(i,2)+X(active),Data_agglo(i,3)+Y(active),'o');
hold on
end