On Mon, Jun 25, 2012 at 7:39 AM, Slumberland <[email protected]> wrote: > Okay, that's maybe not the answer you're looking for. > > What he means is that you can't plot it explicitly without solving for y. > "Implicit" is another way of saying > "not in the form y = " > (or z= , x = .... etc) > > But it can be instructive to figure out how to plot the functions which > define a circle. Is that what you want? > > Sage will solve the equation for you. You can type > > sage: x,y = var('x,y') > sage: b = x^2 + y^2 == 4 > sage: c = solve(b,y) > sage: c > > [y == -sqrt(-x^2 + 4), y == sqrt(-x^2 + 4)] > > > The command "solve(b,y)" solves your equation for the variable y. > > Plotting this way is awkward but you can do it. In this case, we need each > of the functions > > -sqrt(-x^2+4), > > sqrt(-x^2+4) > > > Both of these are stored in c. > > To get them, you can tell python what parts you want: > > c[0].rhs() gives you the right-hand-side{ ;-) of the first equality stored > in c > > c[1].rhs() grabs the second. > > So, you could do this: > > > sage: bottom = plot( c[0].rhs(), xmin=-3, xmax=3, aspect_ratio=1) > > sage: top = plot(c[0].rhs(), xmin=-3, xmax=3) > > sage: show(bottom+top) > > > and the graph will show, but Python complains that it can't evaluate the > function at some points. > > > implicit_plot() is easier to use, that's all.
Thanks for explaining the things . :-) It executed the code and it gives half circle. Anyways if it gives warnings then we should not do this way. Thanks once again. -- Priyanka Kapoor priyankacool10.wordpress.com Linux User Group, Ludhiana -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
