I want to change cart to polar !

1 次查看(过去 30 天)
Kwon
Kwon 2012-11-26
I want to change cart coordinate to polar system
for example
I read a image file and this value change to double value.
then this array is 3d value
and this chage to polar system
and I want to plot(r,theta) this polar system value ( not polar(r,theta)!!)
I want to see the plot that is plotting linear!!
help about this!
if true
% clear all;
clc
a=imread('slice.png');
b=double(a);
imagesc(b);
center=b(512,512);
Z=zeros(2000,3);
for r=1:1:512;
for t=1:1:512;
x=512+r;
y=512+t;
theta=((tan(t/r))^(-1)*180/pi);
radi=sqrt(r^2+t^2);
bvalue=b(x,y);
end
Z=[Z;radi,theta,bvalue];
end
plot(Z);code
end

回答(1 个)

John Petersen
John Petersen 2012-11-29
theta = atan2(t,r)*180/pi;

类别

Help CenterFile Exchange 中查找有关 Polar Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by