0
$\begingroup$

ContourPlot3D[{x^2 + y^2 == z, 2 y == z, x^2 + (y - 1/2)^2 == 1}, {x, -2, 2}, {y, -0.5, 1}, {z, 0, 2}]

The above isn't what I'm seeking. I'd like to plot $x^2 + (y - 1/2)^2 = 1$ in 2D, so as a circle on the xy-plane ($z = 0$), in the same graph as the other two functions that I'd like in 3D. How would I do this?

halirutan's answer nearly resolves this, but his plot still contains $x^2 + (y - 1/2)^2 = 1$ in 3D for all $z$.
I want solely the trace in the xy-plane, for the combined plot of all 3 functions.

$\endgroup$
1
  • 1
    $\begingroup$ Do you mean you want to get rid of the 3D surface $x^2 + (y - 1/2)^2 = 1$ in halirutan's plot? Just remove it from the ContourPlot3D: i.stack.imgur.com/TKsvo.png (although I prefer i.stack.imgur.com/OVJ3R.png). $\endgroup$
    – user484
    Apr 26, 2014 at 22:09

1 Answer 1

5
$\begingroup$

You question is not completely clear. What you can do is the following: You make a 2d contour plot of your second equation and transform this into a 3d graphics by appending a 0 (z=0) to all Line points appearing in the 2d graphics and turning the lines into Tube's:

Show[
 ContourPlot3D[{x^2 + y^2 == z, 2 y == z, 
   x^2 + (y \[Minus] 1/2)^2 == 1}, {x, -2, 2}, {y, -0.5, 1}, {z, 0, 
   2}, ContourStyle -> Opacity[.3]],
 Graphics3D[{Red, 
   Cases[Normal[
     ContourPlot[x^2 + (y - 1/2)^2 == 1, {x, -2, 2}, {y, -1/2, 1}]], 
    Line[pts_] :> Tube[Append[#, 0] & /@ pts], Infinity]}],
 PlotRange -> All
 ]

Mathematica graphics

$\endgroup$
3
  • $\begingroup$ +1. Thanks. I emended my question. Do you seize it now? $\endgroup$
    – user9983
    Apr 4, 2014 at 6:18
  • 1
    $\begingroup$ @LePressentiment So you don't want a combined plot? Your 2d graphics can be obtained by ContourPlot[x^2 + (y - 1/2)^2 == 1, {x, -2, 2},{y, -1/2, 1}]]. The question remains, what do you want to do with this 2d graphic? $\endgroup$
    – halirutan
    Apr 4, 2014 at 6:57
  • $\begingroup$ Thanks. I do want a combined plot. I've emended my question again. Does this answer your question: "The question remains, what do you want to do with this 2d graphic?" $\endgroup$
    – user9983
    Apr 5, 2014 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy