isosurface in cylindrical coordinates

32 vues (au cours des 30 derniers jours)
Marcel Lacroix
Marcel Lacroix le 3 Fév 2021
Commenté : Marcel Lacroix le 11 Fév 2021
Hi.
How can I plot a 3D surface of the function F(r, theta,z) with 'isosurface'? The cylindrical coordinates are r, theta and z (r is the radius, theta is the angle and z is the axial coordinate)?
A million thanks for your help

Réponse acceptée

darova
darova le 4 Fév 2021
Modifié(e) : darova le 4 Fév 2021
Use isosurface normally
[f,v] = isosurface(R,THETA,Z,F,isovalue); % returns faces and vertices
Convert cylindrical coordinates into cartesian
x = v(:,1).*cos(v(:,2));
y = v(:,1).*sin(v(:,2));
z = v(:,3);
Use patch to plot
patch('Faces',f,'Vertices',[x y z])
  1 commentaire
Marcel Lacroix
Marcel Lacroix le 11 Fév 2021
It works. Many many thanks for your help.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by