clear
clc
r=100;%半径
[x,y,z]=sphere(50);%单位球坐标
%中心球
x=r*x;y=r*y;z=r*z;
%一号球
x1=x+50;y1=y;z1=z;
%二号球
x2=x+25;y2=y+25*sqrt(3);z2=z;
%三号球
x3=x+25;y3=y+30*sqrt(3);z3=z+50;
figure
hold on
I1=(x-50).^2+y.^2+z.^2
scatter3(x(I),y(I),z(I),'.b')
I1=x1.^2+y1.^2+z1.^2
scatter3(x1(I),y1(I),z1(I),'.c')
I1=x2.^2+y2.^2+z2.^2
size(I)
scatter3(x2(I),y2(I),z2(I),'.m')
I1=x3.^2+y3.^2+z3.^2
scatter3(x3(I),y3(I),z3(I),'.g')
% mesh(x,y,z)
% mesh(x1,y1,z1)
% mesh(x2,y2,z2)
% mesh(x3,y3,z3)
axis equal
view(3)