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.

This question already has an answer here:

I am an new user of Mathematica and learning basics so please guide me

I tried to use this code

Animate[Plot[x^2/a^2 - y^2/b^2 == 1, {x, 0, 2}, {y, 0, 2}], 
  {a, 1, 3}, 
  {b, 1, 3}]

but I got this error message:

Plot::nonopt: Options expected (instead of {y,0,2}) beyond position 3 in Plot[x^2/FEa$$116^2-y^2/FEb$$116^2==1,{x,0,2},{y,0,2}]. An option must be a rule or a list of rules. >>

All I want to do is to animate a hyperbole with its asymptotes.

share|improve this question
    
@ b.gatessucks i don't know that . if you know ,just write the answer –  Hash Sep 13 '13 at 13:57
3  
Hi Hash. Functions are case-sensitive, and Plot only takes one variable. Try to get a Plot first, then animate it? –  cormullion Sep 13 '13 at 13:59
    
Related: Coloring a shape according to a function –  Artes Sep 13 '13 at 14:36
    
If it's animated hyperbole you are after, maybe use conspiracy plots. Or perhaps CounterPlot. (Sorry, it's Friday..) –  Daniel Lichtblau Sep 13 '13 at 15:44
add comment

marked as duplicate by Jens, Artes, rm -rf Sep 13 '13 at 17:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 3 down vote accepted
Animate[ContourPlot[x^2/a^2 - y^2/b^2 == 1, {x, -6, 6}, {y, -6, 6}, 
  PerformanceGoal -> "Quality"], {a, 1, 5}, {b, 1, 5}]

OR

Manipulate[ContourPlot[x^2/a^2 - y^2/b^2 == 1, {x, -6, 6}, {y, -6, 6}, 
  PerformanceGoal -> "Quality"], {a, 1, 5}, {b, 1, 5}]

If you want the plots with the asymptotes, use the following:

Animate[ContourPlot[{x^2/a^2 - y^2/b^2 == 1, a y + b x == 0, 
   a y - b x == 0}, {x, -5, 5}, {y, -5, 5}, PerformanceGoal -> "Quality"], {a, 1, 5}, {b, 1, 5}]

OR

Manipulate[ContourPlot[{x^2/a^2 - y^2/b^2 == 1, a y + b x == 0, 
   a y - b x == 0}, {x, -5, 5}, {y, -5, 5}, PerformanceGoal -> "Quality"], {a, 1, 5}, {b, 1, 5}]
share|improve this answer
    
is it possible to generate hyperbole along with its asymptotes –  Hash Sep 13 '13 at 14:35
    
@Hash. Yes. See my edit –  RunnyKine Sep 13 '13 at 14:48
    
Maybe you need PerformanceGoal -> "Quality" in ContourPlot –  chyaong Sep 13 '13 at 15:00
    
@chyanog. Good call. Added it. Thanks. –  RunnyKine Sep 13 '13 at 15:04
    
so Quality is also a in-built function in mathematica and now the hyperbole looks nice –  Hash Sep 13 '13 at 16:30
add comment

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