function drawFilledCapsle(ElectronFC,N,r,r2)
% function draw_sphere(Electron_NEW_BS)

j = 1;
r =  500;
r2 = 300;
a = [0,0,0,r];
a2 = [0,0,0,r2];

figure
for i = 1:N
ind =  ElectronFC(j).IndexDraw(i,1);
X = ElectronFC(j).X(i,1:ind);
Y = ElectronFC(j).Y(i,1:ind);
Z = ElectronFC(j).Zcalc(i,1:ind);
Xn = ElectronFC(j).Xn(i,1);
Yn = ElectronFC(j).Yn(i,1);
Zn = ElectronFC(j).Zn(i,1);

XnC = ElectronFC(j).ISn(i,1);
YnC = ElectronFC(j).ISn(i,2);
ZnC = ElectronFC(j).ISn(i,3);
Xn2C = ElectronFC(j).ISn4(i,1);
Yn2C = ElectronFC(j).ISn4(i,2); 
Zn2C = ElectronFC(j).ISn4(i,3);

[x,y,z]=sphere;
[x2,y2,z2] = sphere;

% s1=surf(x*a(1,4)+a(1,1),y*a(1,4)+a(1,2),z*a(1,4)+a(1,3));
% set(s1, 'FaceAlpha', 0.5);

m1=mesh(x*a(1,4)+a(1,1),y*a(1,4)+a(1,2),z*a(1,4)+a(1,3));
set(m1, 'FaceAlpha', 0.5);
hold on
m2=mesh(x2*a2(1,4)+a2(1,1),y2*a2(1,4)+a2(1,2),z2*a2(1,4)+a2(1,3));
set(m2, 'FaceAlpha', 0.5);
% plot3([0,X(3)],[0,Y(3)],[0,Z(3)],'r-*')
plot3([Xn X],[Yn Y],[Zn Z],'k-+')
end
xlabel('X');ylabel('Y');zlabel('Z');