create_spheres.m
来自「this a 3d fdtd code using matlab and it 」· M 代码 · 共 16 行
M
16 行
disp('creating spheres');
cx = fdtd_domain.cell_center_coordinates_x;
cy = fdtd_domain.cell_center_coordinates_y;
cz = fdtd_domain.cell_center_coordinates_z;
for ind=1:number_of_spheres
% distance of the centers of the cells from the center of the sphere
distance = sqrt((spheres(ind).center_x - cx).^2 ...
+ (spheres(ind).center_y - cy).^2 ...
+ (spheres(ind).center_z - cz).^2);
I = find(distance<=spheres(ind).radius);
material_3d_space(I) = spheres(ind).material_type;
end
clear cx cy cz;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?