4
Plot3D[{-5 - x - y, -Sqrt[8 x^2 + 8 y^2]}, {x, -5, 5}, {y, -5, 5}, 
 Mesh -> None, BoxRatios -> {1, 1, 1}, PlotLegends -> "Expressions"]

a plane intercepting a cone

marle
  • 145
  • 1
  • 7

2 Answers2

9

Using BoundaryStyle

Use the option BoundaryStyle and set the option value to {{1, 2} -> Directive[Thick, Red]}:

Plot3D[{-5 - x - y, -Sqrt[8 x^2 + 8 y^2]}, {x, -5, 5}, {y, -5, 5}, 
 Mesh -> None, BoxRatios -> {1, 1, 1},
 BoundaryStyle -> {{1, 2} -> Directive[Thick, Red]} ]

enter image description here

Note: This particular usage for BoundaryStyle in not documented. The earliest reference on this site is this answer by Daniel Lichtblau

Using MeshFunctions

Use the difference between the two functions as the setting for option MeshFunctions:

Plot3D[{-5 - x - y, -Sqrt[8 x^2 + 8 y^2]}, {x, -5, 5}, {y, -5, 5}, 
 MeshFunctions -> {-5 - # - #2 - (-Sqrt[8 #^2 + 8 #2^2]) &}, 
 Mesh -> {{{0, Directive[Red, Thick]}}}, BoxRatios -> {1, 1, 1}, 
 PlotLegends -> "Expressions"]

enter image description here

kglr
  • 394,356
  • 18
  • 477
  • 896
  • +1 Of course. Interestingly, your specific application of BoundaryStyle does not seem to be documented on its documentation page. Where did you learn about this? – Sjoerd C. de Vries Mar 19 '15 at 13:28
  • @SjoerdC.deVries, thanks for the vote. It is not in documentation. I have a faint memory of having seen something like this on this site; but i could not find it with the usual key words. Btw, it does not work in some cases where one would wish it would, e.g. i could not find a way to make it work in [this q/a[(http://mathematica.stackexchange.com/q/58045/125) – kglr Mar 19 '15 at 13:45
  • @SjoerdC.deVries, found the reference: Daniel's answer here – kglr Apr 14 '15 at 20:53
  • Ah, that's great! I see that I voted for it, so I should have known. – Sjoerd C. de Vries Apr 14 '15 at 22:09
6

Find equations for intersection:

Solve[-5 - x - y == -Sqrt[8 x^2 + 8 y^2], x]

{{x -> 1/7 (5 + y - 2 Sqrt[2] Sqrt[25 + 10 y - 6 y^2])}, {x -> 1/7 (5 + y + 2 Sqrt[2] Sqrt[25 + 10 y - 6 y^2])}}

Range of y:

Solve[25 + 10 y - 6 y^2 == 0, y]

{{y -> 5/6 (1 - Sqrt[7])}, {y -> 5/6 (1 + Sqrt[7])}}

Draw intersection:

inter =
 With[
   {
     x1 = 1/7 (5 + y - 2 Sqrt[2] Sqrt[25 + 10 y - 6 y^2]), 
     x2 = 1/7 (5 + y + 2 Sqrt[2] Sqrt[25 + 10 y - 6 y^2])
   },
  ParametricPlot3D[{{x1, y, -5 - x1 - y}, {x2, y, -5 - x2 - y}}, 
    {y, 5/6 (1 - Sqrt[7]), 5/6 (1 + Sqrt[7])}, 
    PlotStyle -> Blue
  ]
]

Mathematica graphics

Add other objects:

cone = Cone[{{0, 0, -Sqrt[200]}, {0, 0, 0}}, 5];
plane = InfinitePlane[{{0, 0, -5}, {-5, 0, 0}, {0, -5, 0}}];

Show[
 Graphics3D[{Opacity[0.8], cone, plane}],
 inter
 ]

Mathematica graphics

Sjoerd C. de Vries
  • 65,815
  • 14
  • 188
  • 323