Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How would I plot $x^2+y^2=1$ in 3D (it would form a cylinder)? Since there is no $z$ in the equation, I can't solve for it and use Plot3D. Or can I just put the equation into Plot3D? I am very new to Mathematica.

share|improve this question
up vote 13 down vote accepted

How about a 3D contour plot.

ContourPlot3D[x^2 + y^2 == 1, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}]
share|improve this answer
    
Oh, great! Thanks! – Ben7005 Sep 16 '12 at 22:52
    
No problem! Have fun Ben. – Mark McClure Sep 16 '12 at 22:54

Although Mark's answer is the "natural" one, here are other options just for completeness:

Use Plot3D, after performing a rotation:

Plot3D[{1, -1} Sqrt[1 - x x], {x, -1, 1}, {y, -1, 1},  AspectRatio -> 1]

Mathematica graphics

Use ParametricPlot3D[]:

ParametricPlot3D[{{1, -1, 1} #, {1, 1, 1} #} &@{x, Sqrt[1 - x x], z}, {x, -1, 1}, {z, 0, 1}]

Mathematica graphics

Use RevolutionPlot3D[] after realizing for example that in the semi/plane {y==0, x>0} x takes only the value 1 and z takes any value (freely):

RevolutionPlot3D[{1, t}, {t, 0, 1}]

Mathematica graphics

share|improve this answer
    
Yet another possibility: ParametricPlot3D[RotationTransform[θ, {0, 0, 1}][{1, 0, r}] // Evaluate, {r, 0, 1}, {θ, 0, 2 π}] – J. M. Sep 17 '12 at 11:00
    
Man, thanks so much for this. This is great. – Ben7005 Sep 19 '12 at 2:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.