Tuesday, 10 September 2013

Arrange Toric Surfaces on top of each other

Arrange Toric Surfaces on top of each other

How can I have these two surfaces on top of each other in the y-plane. I
tried with this code but it didn't work.Can someone offer ideas?I have
tried several ways but they all couldn't work Thanks.
Cx=1/80;
Cy=1/70;
M=6;
Dr=20;
n=2^(M-1);
Vertex=[0 0 0];
phi = (linspace(-pi,pi,n));
r=(linspace(0,Dr,n))';
x = -r*cos(phi)+Vertex(1);
y = -r*sin(phi)+Vertex(2);
z=(Cx*x.^2+Cy*y.^2)./(1+(1-sqrt(Cx*x.^2+Cy*y.^2).^2)./(x.^2+y.^2))+Vertex(3);
surf(z,x,y)
axis
set(gca, 'YDir','reverse');
xlabel('X-axis','fontweight','bold');
ylabel('Z-axis','fontweight','bold');
zlabel('Y-axis','fontweight','bold');
hold on
Vertex=[pi pi pi];
phi = (linspace(-pi,pi,n));
r=(linspace(0,Dr,n))';
x = -r*cos(phi)+Vertex(1);
y = -r*sin(phi)+Vertex(2);
z=(Cx*x.^2+Cy*y.^2)./(1+(1-sqrt(Cx*x.^2+Cy*y.^2).^2)./(x.^2+y.^2))+Vertex(3);
surf(z,x,y)
axis
set(gca, 'YDir','reverse');
xlabel('X-axis','fontweight','bold');
ylabel('Z-axis','fontweight','bold');
zlabel('Y-axis','fontweight','bold');

No comments:

Post a Comment