0
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ @ b.gatessucks i don't know that . if you know ,just write the answer $\endgroup$ – Hash Sep 13 '13 at 13:57
  • 3
    $\begingroup$ Hi Hash. Functions are case-sensitive, and Plot only takes one variable. Try to get a Plot first, then animate it? $\endgroup$ – cormullion Sep 13 '13 at 13:59
  • $\begingroup$ Related: Coloring a shape according to a function $\endgroup$ – Artes Sep 13 '13 at 14:36
  • $\begingroup$ If it's animated hyperbole you are after, maybe use conspiracy plots. Or perhaps CounterPlot. (Sorry, it's Friday..) $\endgroup$ – Daniel Lichtblau Sep 13 '13 at 15:44
3
$\begingroup$
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}]
$\endgroup$
  • $\begingroup$ is it possible to generate hyperbole along with its asymptotes $\endgroup$ – Hash Sep 13 '13 at 14:35
  • $\begingroup$ @Hash. Yes. See my edit $\endgroup$ – RunnyKine Sep 13 '13 at 14:48
  • $\begingroup$ Maybe you need PerformanceGoal -> "Quality" in ContourPlot $\endgroup$ – chyanog Sep 13 '13 at 15:00
  • $\begingroup$ @chyanog. Good call. Added it. Thanks. $\endgroup$ – RunnyKine Sep 13 '13 at 15:04
  • $\begingroup$ so Quality is also a in-built function in mathematica and now the hyperbole looks nice $\endgroup$ – Hash Sep 13 '13 at 16:30

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