plotting a conic section by knowing its standard equation

24 views
Skip to first unread message

Lorenzo Bercelli

unread,
Dec 14, 2014, 2:16:28 PM12/14/14
to sy...@googlegroups.com
hello everybody, I got a very silly question: what's the best way to plot a conic section on a plane if I have its standard equation (e.g.: x^2^+y^^2=1)? I've tried plot but it needs a univariate expression, and I haven't been able to find a method to transform the expression into f(x) = \pm sqrt(1-x^2)

Aaron Meurer

unread,
Dec 14, 2014, 5:07:50 PM12/14/14
to sy...@googlegroups.com
To get a set of functions to plot, you would use solve(), like
solve(Eq(x**2 + y**2, 1), y). This will return two solutions, which
when plotted simultaneously, should give a full circle.

An easier way is to use plot_implicit(), which doesn't require
solving, and will work even for equations that can't be solved by
solve().

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/14f0c91a-2ce1-4b25-8875-6ae54f901cb3%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages