Ask Your Question
0

How to plot a parabola (conic): y²=4ax

asked 2015-08-06 01:57:59 +0100

mellow_yellow gravatar image

updated 2015-08-06 01:58:34 +0100

I'm learning about conics, specifically parabolas, and I'd like to plot them. I already know how to do plot(x^2)), but what about y²=4ax ? I understand that representation is a relation, not a function, so that probably eliminates plot(f(x)). But, I'm stuck on how I might plot that so-called "general form" of a parabola.

Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2015-08-06 04:54:13 +0100

dazedANDconfused gravatar image

updated 2015-08-06 05:00:26 +0100

You could try plotting it as two functions but implicit_plot is the natural choice. The documentation is here. This simple code illustrates how it could be done, given a specific value of a:

x, y = var('x,y')
a=1.1
implicit_plot(y^2==4*a*x, (x,-2,10), (y,-8,8))

Note the double equal signs. You can run the code in any Sage Cell Server, such as here, to check the result. Plotting it as two functions:

a=1.1
A = plot(2*sqrt(a*x), (x, -2, 10))
B = plot(-2*sqrt(a*x), (x, -2, 10))
(A+B).show()

and with a little complaining Sage plots over values that avoids problems with the domain.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-08-06 01:57:59 +0100

Seen: 1,380 times

Last updated: Aug 06 '15