# how to draw the intersection when a function intersected by a plane

I'm sorry, this maybe a very basic question. $z=x^2+y^2$ that intersects a plane passing through the point (1, −1, 2), which is perpendicular to the xy-plane and parallel to the vector $u<\frac{3}{5},-\frac{4}{5}>$. the graph should look like The equation for a plane that using a point on that plane plus the normal vector is

$$\mathbf{n} \cdot (\mathbf{r}-\mathbf{r}_0)=0$$

So we need the normal vector for the plane, and we have enough information to get it. You know your plane is perpendicular to the xy plane, which means the normal vector is parallel to the xy plane, i.e. it has no z component, so we just need the x and y components. This is simple enough to do by hand, using the method described here, but we are using Mathematica so let's do it that way,

Solve[{{3/5, -4/5}.{x, y} == 0, Norm[{x, y}] == 1}, {x, y}]
(* {{x -> -(4/5), y -> -(3/5)}, {x -> 4/5, y -> 3/5}} *)


Either of these will work, but we'll choose the latter

We can plot the above equation with ContourPlot3D and the function using Plot3D, and combine them using Show:

With[{r = {x, y, z},
n = {4/5, 3/5, 0},
r0 = {1, -1, 2}},
Show[
Plot3D[x^2 + y^2, {x, -5, 5}, {y, -5, 5}],
ContourPlot3D[n.(r - r0) == 0, {x, -4, 4}, {y, -4, 4}, {z, 0, 50},
ContourStyle -> Blue]
]
] We need a bit of work to make it look like your plot. First, we want to have the nice bowl-shape of a 2D parabola, so we use RegionFunction as described here. Then we want to show the point and the vector u, so we'll use some Graphics3D primitives for that.

With[{r = {x, y, z},
n = {4/5, 3/5, 0},
r0 = {1, -1, 2}},
Show[
Plot3D[x^2 + y^2, {x, -5, 5}, {y, -5, 5},
RegionFunction -> Function[{x, y, z}, x^2 + y^2 < 16]],
ContourPlot3D[n.(r - r0) == 0, {x, -4, 4}, {y, -4, 4}, {z, 0, 32},
ContourStyle -> Blue],
Graphics3D[{Darker@Magenta, PointSize[.05], Point[r0]}],
Arrow[Tube[{{1/4, 0, 0}, {1/4, 0, 0} + 5 {3/5, -4/5, 0}}, .2]]}]
]
] There are many ways to do this. Here is one (and not the best or neatest):

p1 = {1, -1, 2};
p2 = {3/5, -4/5, 0};
n[x_, y_, z_] := Normalize[Cross[p1, p2]].({x, y, z} - p1);
plane[x_, y_] := (w /. Solve[n[u, v, w] == 0, w]) /. {u -> x, v -> y}
p3d = Plot3D[{x^2 + y^2, plane[x, y]}, {x, -1.5, 1.5}, {y, -1.5, 1.5},
Mesh -> None, BoxRatios -> {1, 1, 2}, PlotStyle -> Opacity[0.5]];
pp = Quiet@
Module[{sol = First@Solve[{x^2 + y^2 == plane[x, y]}, {x, y}]},
ParametricPlot3D[{x, y /. sol, x^2 + y^2 /. sol}, {x, -2, 2},
PlotStyle -> Red]];

g = Graphics3D[{Black, PointSize[0.02], Point[{p1, p2}], If you merely wish to show intersection look at Mesh and related functions.
• I was wondering why the plane wasn't perpendicular to the xy plane, and I think it's because you have the normal vector as the cross product between p1 and p2, but p1 is just the coordinate that the plane passes through. So the plane you solve for is perpendicular to the line from the origin to the point. To get the right normal vector, you should replace p1 with {0, 0, 1} in the cross product, but I'm not sure how to get the plane with Plot3D – Jason B. Mar 3 '16 at 9:02