1. How can I create a own 3D scalar data volume like "flow", 3D- spiral ?

3 次查看(过去 30 天)
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 个评论
Wolfgang
Wolfgang 2025-2-27
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.

请先登录,再进行评论。

回答(1 个)

Dev
Dev 2025-2-25
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.

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by