|
I want to define a single function that gives me exactly the same as the figure defined as follows. As you can see, i have to change the value of beta twice to get what i want. Is there a way that I can define such a shape by a single function of beta and theta?
% the function
k2=-2; k3=2/30;
rx=10.5; ry=10.5; rz=10;
theta=-pi/2:pi/100:pi/2;
x=[]; y=[ ];
for i=1:2
beta=pi*i;
g=(ry/10)*( 2.^(k2.*theta)+ 2.^(k3.*theta));
%% x,y values
x1=rx.*cos(theta).*cos(beta);
y1=ry.*sin(theta)+g;
x=[x;x1'];
y=[y;y1'];
end
x0=mean(x);
y0=mean(y);
plot(x-x0,y-y0)
hold on
plot(x0,y0,'.y')
%mesh(x,y,z)
axis equal;
grid off;
axis ij;
axis off
thanks,
TE
|