Converting Polar Gridded Data to Cartesian Gridded Data
Afficher commentaires plus anciens
I am building a temperature distribution solver for a project and currently have a gridded temperature distribution in cylidrical coordinates. (R, Theta, Z). By my understanding this allows me to retain the temperature distribution as a 3d matrix with no corrolation to the true size of the object the matrix is describing. This allows me to theoretically use the isosurface functions to plot the outer surface and thus any other surface for my cylinder. I am stuck trying to convert my polar data to cartesian and interpolating the values in cartesian coordinates that dont exist in polar coordinates. I expect I could use 'grid data' or 'gridded interpolant' but these functions dont do what I am expecting. I could also slice the grids of my polar gridded data and use pol2car(th,r,z) where z is the temperature value accross the 'slice' but this also does not work as expected. I am unfamiliar with all of the functions I have mentioned and thus dont know what matlab expects and an input or output nor the math within the function.
Here is an example of what I am trying to do
T_Dat_pol = zeros(N_r, N_theta, N_z); % number of descritized points in r, th, and z directions
for i = 1:1:N_r
T_Dat_pol(i, :, :) = i; % (r, th, z)
end
%convert to cartesian.
T_Dat_cart = zeros(N_r^2, N_r^2, N_z) % (x, y, z)
T_Dat_pol represents a cylinder where the temperature varies only in the radial direction. With my current solution architechture r = 1 is the outer diameter. I would need to convert this to cartesian coordinates of arbitrary dimensions where x = 1/2 length(x), y = 1/2 length(y) is the midpoint of the cylinder.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Interpolation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!