Ask Your Question

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

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

mellow_yellow gravatar image

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

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.


edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

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

dazedANDconfused gravatar image

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

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')
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 = plot(2*sqrt(a*x), (x, -2, 10))
B = plot(-2*sqrt(a*x), (x, -2, 10))

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


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

Seen: 1,318 times

Last updated: Aug 06 '15