I don't know how to fix it so that parametric_plot works. However, the
following workaround at least gives you a plot:

sage: a = RR(1729^(1/3))
sage: f1 = lambda x: RR(real((1729 - x^3)^(1/3)))
sage: f2 = lambda x: RR(real(-(-1729 + x^3)^(1/3)))
sage: L1 = [(x,f1(x)) for x in srange(-a+0.1,-15,0.5)]
sage: L2 = [(x,f2(x)) for x in srange(-a+0.1,a-0.1,0.5)]
sage: L3 = [(x,f1(x)) for x in srange(a+0.1,15,0.5)]
sage: list_plot(L1+L2+L3, plotjoined=True)


On Feb 16, 2008 5:08 AM, bill.p <[EMAIL PROTECTED]> wrote:
>
>
>
> On Feb 12, 10:07 am, bill purvis <[EMAIL PROTECTED]> wrote:
> > I wanted to make a plot of x^3+y^3=1729 (the well-known taxicab problem).
> > I'm sure there are better ways of acieving this but I opted for a naive
> > approach:
> >
> > {{{
> > def sng(x):
> >   if x < 0:
> >     return -1
> >   return 1
> >
> > def f(x):
> >   y3 = 1729 - x^3
> >   return sgn(y3) * abs(y3)^(1/3)
> >
> > }}}
> >
> > {{{
> > c = parametric_plot((x,f(x)),-15,15)
> > c.show()
> >
> > }}}
> >
> > (I want to add other things to the plot).
> > However, when I run this in the notebook, the plot has a cusp at x=12+
> > and behaves as if the sgn(x) has been taken as +1. I tried evaluating
> > f(x) at 12 and 13 and the result changes sign as I'd expect.
> > Am I doing something totally stupid or is there a bug here?
> >
> > Bill
> > (still running 2.10.1.rc3 on Linux, Ubuntu 7.10 on a Toshiba Equium laptop)
> > --
> > +---------------------------------------+
> > | Bill Purvis, Amateur Mathematician    |
> > |  email: [EMAIL PROTECTED]                  |
> > |  http://bil.members.beeb.net         |
> > +---------------------------------------+
> Still no response to this problem, either....
>
> Bill
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to