
1. How can I create a own 3D scalar data volume like "flow", 3D- spiral ?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Dear all,
please tell me (write a script) how can I create a 3D data volume of a spiral.
Starting with a cylinder (radius r and height h, the upper half of the cylinder should be a spiral.
How can I create a 3D data volume in general [x,y,z] coordiantes from 3d polar coordinates[r, theta, phi]
Thanks a lot,
wolfgang Treimer
1 Commento
Wolfgang
il 27 Feb 2025
Thank you for your help, indeed that is a diffrent way to create a 3D data volume of a sprial. However, it does not create a volume like that:

Best regards;
Wolfgang.
Risposte (1)
Dev
il 25 Feb 2025
Hi Wolfgang,
By mentioning a 3D data volume, I am assuming that you refer to a collection of data points in three-dimensional space which collectively represent a geometric shape or structure. To create a 3D data volume of a spiral starting with a cylinder, I am assuming that you want to construct a 3D shape that starts as a cylinder and transitions into a spiral. Polar coordinates are used to define the structure but have to be converted into cartesian coordinates for representation and visualization.
To achieve this, we can follow the following steps as mentioned-
- Define the Cylinder: Define the radius and height of the cylinder.
- Create Polar Coordinates: For the lower half of the cylinder, use a simple cylindrical coordinate system. For the upper half, define a spiral by varying theta and z while keeping r constant.
- Convert to Cartesian Coordinates: Use the transformation equations to convert polar coordinates (r, theta, phi) to cartesian coordinates (x, y, z). An example to do the same is mentioned below-
% Convert polar coordinates to cartesian coordinates
X2 = R2 .* cos(Theta2);
Y2 = R2 .* sin(Theta2);
After converting the polar coordinates for the lower half and the upper spiral of the cylinder to cartesian coordinates, we can combine them to plot it using the ‘scatter3’ function. This function helps us construct a 3D scatter plot, more info on the same can be referred below-
I hope this achieves the purpose.
0 Commenti
Vedere anche
Categorie
Scopri di più su Surface and Mesh 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!