Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

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

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
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

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

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.