plot3 with implicit domain

1 visualizzazione (ultimi 30 giorni)
Niklas Kurz
Niklas Kurz il 27 Apr 2021
Modificato: Niklas Kurz il 2 Mag 2021
I'd like to plot f(u,v) = (u,v,sqrt(1-u^2-v^2)) whereas u^2+v^2 <1;
I thought of using plot3 and defining
[u,v] = deal(linspace(-2,2,200));
Thing is, I got to incorporate the implicit condition somehow. Fimplicit3 doesn't help here. I could probalby solve for one of the variables and substitute but that's getting already complex in my head. Is there a handy solution?

Risposta accettata

DGM
DGM il 27 Apr 2021
Maybe something like this?
n = 50;
u = linspace(-2,2,n);
v = linspace(-2,2,n)';
f = u.^2 - v.^2; % the function
dm = (u.^2 + v.^2)<1; % the domain mask
f(~dm) = NaN; % NaN values don't plot
mesh(u,v,f)
axis equal
colormap(1-ccmap)
title('Math Pringle')
  5 Commenti
Niklas Kurz
Niklas Kurz il 29 Apr 2021
Modificato: Niklas Kurz il 2 Mag 2021
that illustration was beautiful

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Data Distribution Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by