How would I make an diagram like this

1 vue (au cours des 30 derniers jours)
Benjamin Cai
Benjamin Cai le 26 Nov 2019
Commenté : Rena Berman le 12 Déc 2019
How would i get started make the hemisperical disk and a semisphere in the middle
  1 commentaire
Rena Berman
Rena Berman le 12 Déc 2019
(Answers Dev) Restored edit

Connectez-vous pour commenter.

Réponse acceptée

Nathan Jessurun
Nathan Jessurun le 26 Nov 2019
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

Plus de réponses (0)

Catégories

En savoir plus sur Orange dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by