Effacer les filtres
Effacer les filtres

Plot the part of the cylinder x^2 + z^2 = 1 for y ≥ 0 , 0 ≤ z ≤ − y^2 + 1 . Can someone help me

10 vues (au cours des 30 derniers jours)
dang thai bao
dang thai bao le 11 Mai 2021
Réponse apportée : DGM le 11 Mai 2021
i don't know how to do it

Réponses (1)

DGM
DGM le 11 Mai 2021
This is a rather simple approach:
n = 200;
th = linspace(0,pi,n);
x = linspace(-1,1,n);
y = linspace(0,1,n).';
zc = repmat(sin(th),[n 1]);
xc = cos(th);
zp = repmat(-y.^2+1,[1 n]);
zc(zc>zp) = NaN;
surf(xc,y,zc); hold on
shading flat
axis equal
If you want to be assured that the trimmed face follows a parabola:
n = 200;
th = linspace(0,pi,n);
x = linspace(-1,1,n);
y = linspace(0,1,n).';
zc = repmat(sin(th),[n 1]);
xc = cos(th);
zp = repmat(-y.^2+1,[1 n]);
zc(zc>zp) = NaN;
surf(xc,y,zc); hold on
surf(x,y,zp,'facealpha',0.4);
shading flat
axis equal

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by