http://www.mathworks.com/matlabcentral/newsreader/view_thread/284491
MATLAB Central Newsreader  Cartesian  cylindrical transformations
Feed for thread: Cartesian  cylindrical transformations
enus
©19942015 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Sat, 12 Jun 2010 16:28:05 +0000
Cartesian  cylindrical transformations
http://www.mathworks.com/matlabcentral/newsreader/view_thread/284491#753956
Bogathi
hi,<br>
Recently i have problem in plotting a function. here it is<br>
E_i = (E_x, E_y,E_z), components of a vector in Cartesian. Each of the component is a function of cylindrical coordinates, ie.,E_i is 3d matrx . I want to plot these components in Cartesian planes  XZ,YZ. I could get XY from pol2cart command.<br>
Can any one help in this regard.<br>
Thnks in advance.<br>
Reddy

Sat, 12 Jun 2010 19:50:24 +0000
Re: Cartesian  cylindrical transformations
http://www.mathworks.com/matlabcentral/newsreader/view_thread/284491#753986
Roger Stafford
"Bogathi " <bogathi.reddy@gmail.com> wrote in message <hv0cil$5j9$1@fred.mathworks.com>...<br>
> hi,<br>
> Recently i have problem in plotting a function. here it is<br>
> E_i = (E_x, E_y,E_z), components of a vector in Cartesian. Each of the component is a function of cylindrical coordinates, ie.,E_i is 3d matrx . I want to plot these components in Cartesian planes  XZ,YZ. I could get XY from pol2cart command.<br>
> Can any one help in this regard.<br>
> Thnks in advance.<br>
> Reddy<br>
<br>
If I understand you correctly, I can't see that there is any difficulty here. You apparently want surface plots made of each of the vector field components for planes orthogonal to each of the three cartesian axes. Each of these components is a known function of the cylindrical coordinates, r, t (theta), and z. (I'm assuming the usual definition of cylindrical coordinates in terms of x, y, and z holds.)<br>
<br>
For a plane orthogonal to the yaxis ("XZ plane"), just establish a rectangular mesh in x and z coordinates with y held to some constant, y0.<br>
<br>
[X,Z] = meshgrid(linspace(x1,x2),linspace(z1,z2)); % x and z limits<br>
R = sqrt(X.^2+y0^2);<br>
T = atan2(y0,X);<br>
<br>
For the E_x component, for example, do this plot:<br>
<br>
surf(X,Z,E_x(R,T,Z))<br>
<br>
where E_x can be evaluated, as you have said, in terms of r, t, and z. This gives you a rectangular grid of points as projected onto the XZ plane.<br>
<br>
Roger Stafford