Triet
Posts:
3
Registered:
12/29/12


Plot the intersection of two 3d plot
Posted:
May 20, 2013 9:51 AM


I have two function z=f(x,y) and z=g(x,y) and I have plotted it but how can I plot the curve of intersection between those two? And can you check my script below as well? Feel free to critic and edit it! My program:
syms x y z; g=@(x,y) xy6; ..... (There're more things here but it doesn't matter)..... clf hold on; axis square; t=100:100; funplot1=a.*sqrt(1+((t.^2)/(b.^2))); [d1, d2, d3] =cylinder(funplot1); h1=surf(d1,d2,d3,'LineStyle','','FaceLighting','phong','EdgeAlpha',0.2,'FaceAlpha',0.4,'EdgeColor','red','FaceColor','yellow') xr=100:100; yr=100:100; gz=ones(size(xr,2),size(yr,2)); for i=1:size(xr) for j=1:size(yr) end end for i=1:size(xr,2) for j=1:size(yr,2) gz(i,j)=f(xr(i),yr(j)); end end h2=surf(xr,yr,gz,'LineStyle','','FaceLighting','phong','EdgeAlpha',0.2,'FaceAlpha',0.4,'EdgeColor','green','FaceColor','blue'); ....(The intersection plot code should be here)... end
I'm a newbie in Matlab so please help me! Sorry for my poor English! Thanks in advance!

