How do I outline the intersection between a plane an a cone in 3D?

8 次查看(过去 30 天)
I have 2 3D graphs of a plane and cone, and while they obviously intersect, I want to find a way to highlight their intersection in a different color. How would I go about doing this?
Here is the code for the existing graphs
r = linspace(0,2*pi) ;
th = linspace(0,2*pi) ;
[R,T] = meshgrid(r,th) ;
X = R.*cos(T) ;
Y = R.*sin(T) ;
Z = R ;
figure
surf(X,Y,Z)
hold on
surf(-X,-Y,-Z)
[x, y] = meshgrid(-1:0.1:1); % Generate x and y data
z = 5* x;
s = surf(x,y,z) %Plot the surface
s.EdgeColor = 'red'
colorbar
  4 个评论
Matt J
Matt J 2019-6-24
编辑:Matt J 2019-6-24
What is the difference that you see between the outline of the conic section and the intersection? Do you mean the cone is not hollow and you want to shade the 2D region of intersection with the solid cone, enclosed by the conic section?
Satwik Misra
Satwik Misra 2019-6-25
编辑:Satwik Misra 2019-6-29
Yes that is exactly what I mean, sorry if I was unclear before. It honestly doesn't matter whether it is an outline or whether the intersection is shaded, but I just want to see both 3D graphs along with the intersection.
Edit: It would also be helpful if I could extrapolate the 2D part of the graph that shows the intersection

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Directed Graphs 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by