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.
On Monday, May 7, 2012 8:55:22 AM UTC-7, Jason Grout wrote:
On 5/7/12 10:27 AM, Priyanka Kapoor wrote:
> >> Please note that I wrote
> >>
> >> b = x^2+y^2==4
> >
> > I got a plot.thank you. Sir , can't we draw it using plot() function.
>
> No, because it's not a y=... function.
>
> If all you want is a circle, you can also use the circle function:
>
> circle((0,0), 4)
>
> Thanks,
>
> Jason
>
>
--
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