Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I wish to plot the graph of a surface while being able to change a parameter.

My current code is

ContourPlot3D[(Cos[Pi/4]+x Cos[0]Sin[Pi/4]+y Sin[0]Sin[Pi/4])^2 == 
 (1+x^2+y^2)Cos[a]^2, {x, -10, 10}, {y, -10, 10}, {z, -10, 10}, 
 {a = 0 .. Pi}, AxesLabel -> {x, y, z}]

I don't want to do it with Manipulate[], since I don't a the graph of the surface of a given "a" between 0 and Pi, but the graph of the surface with "a" from 0 to Pi.

share|improve this question
You need to work on your input. It does not make much sense. –  chris Nov 4 '12 at 22:16
add comment

2 Answers 2

up vote 2 down vote accepted

Your syntax is wrong, as you probably know. Maybe you want something like this:

   (Cos[Pi/4] + x*Cos[0] Sin[Pi/4] + y*Sin[0] Sin[Pi/4])^2 == (1 + 
       x^2 + y^2) Cos[a]^2, {a, 0, \[Pi], .2}], {x, -10, 10}, {y, -10,
   10}, {z, -10, 10}, AxesLabel -> {x, y, z}]

Mathematica graphics


   (Cos[Pi/4] + x*Cos[0] Sin[Pi/4] + y*Sin[0] Sin[Pi/4])^2 == (1 + 
       x^2 + y^2) Cos[a]^2, {x, -10, 10}, {y, -10, 10}, {z, -10, 10}, 
   Mesh \[Rule] None, AxesLabel -> {x, y, z}, 
   ContourStyle \[Rule] FaceForm[{Pink, Opacity[0.8]}]
  {a, 0, \[Pi], .5}

Mathematica graphics

share|improve this answer
add comment

May be (I am doing a lot of guessing, but it seems consistent with @acl's guess!)

Table[ContourPlot[(Cos[Pi/4] + x Cos[0] Sin[Pi/4] + 
        y Sin[0] Sin[Pi/4])^2 == (1 + x^2 + y^2) Cos[a]^2 // 
    Release, {x, -10, 10}, {y, -10, 10}, AxesLabel -> {x, y, z},
   ContourStyle -> Hue[a/Pi // N]],
  {a, 0, Pi, Pi/16}] // Show

Mathematica graphics

share|improve this answer
What I'm looking for is the 3D graph of the evolution of the surface between all of these lines. –  Renaud Nov 4 '12 at 22:37
@Renaud You can do this with acl's code. Just replace {z,-10,10} with {a,0,Pi/2} and get rid of the table and your done. –  sebhofer Nov 4 '12 at 22:47
add comment

Your Answer


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.