MATLAB Answers

How would I make an diagram like this

3 ビュー (過去 30 日間)
Benjamin Cai
Benjamin Cai 2019 年 11 月 26 日
Commented: Rena Berman 2019 年 12 月 12 日
How would i get started make the hemisperical disk and a semisphere in the middle

  1 件のコメント

Rena Berman
Rena Berman 2019 年 12 月 12 日
(Answers Dev) Restored edit

サインイン to comment.

採用された回答

Nathan Jessurun
Nathan Jessurun 2019 年 11 月 26 日
Keep in mind, I made approximations based on your provided figure.
function createHemispheres()
bigCenters = [-1 -1; 1 -1; -1 1; 1 1];
bigRad = 0.8;
% permute for broadcasting operation along 3d dimension
bigCenters = permute(bigCenters, [3 2 1]);
% centers is now 1x2x4 array
[xx,yy] = meshgrid(-1:0.01:1);
bigCircs = bigRad - ((xx - bigCenters(1,1,:)).^2 + (yy - bigCenters(1,2,:)).^2)/bigRad;
% Remove negative values before stacking all circles
bigCircs(bigCircs < 0) = 0;
bigCircs = sum(bigCircs, 3);
smallRad = 0.4;
smallCirc = smallRad - (xx.^2 + yy.^2)/smallRad;
smallCirc(smallCirc < 0) = 0;
hold off;
surf(xx,yy,bigCircs + smallCirc);
axis equal
shading interp
colormap jet
hold on
contour(xx,yy,bigCircs + smallCirc);
end
untitled.png

  0 件のコメント

サインイン to comment.

More Answers (0)

サインイン してこの質問に回答します。

タグ


Translated by