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

6 views (last 30 days)
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 Comments
Matt J
Matt J on 24 Jun 2019
Edited: Matt J on 24 Jun 2019
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 on 25 Jun 2019
Edited: Satwik Misra on 29 Jun 2019
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

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!