# how to plot and animate an hyperbole? [duplicate]

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.

• @ b.gatessucks i don't know that . if you know ,just write the answer – Hash Sep 13 '13 at 13:57
• 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
• – 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

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

• 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 – chyanog 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