On 11/4/10 5:01 AM, David Kirkby wrote:
On 4 November 2010 08:35, Jeroen Demeyer<jdeme...@cage.ugent.be>  wrote:
Over at #8433, we have some 3d plot using Tachyon which works for some
people but not for others.  I believe it would be useful to have some
people test it such that we might determine why it works on some systems
but not on others.

It's just a matter of copy-pasting the code in the bug report from
http://trac.sagemath.org/sage_trac/ticket/8433 to a notebook and seeing
whether the plot "hangs" or not.

Thanks,
Jeroen.

I don't have Sage on this laptop, and are not at home. But I tested it
on t2.math

http://t2nb.math.washington.edu:8000/home/pub/41/
(Solaris 10 SPARC)

and as you can see it does work. Note that is with Sage 4.5.1, so is a
few releases old

For comparison here is the same plot in Mathematica, using:

Plot3D[Sqrt[Sin[x] Sin[y]],{x,-2 Pi, 2 Pi},{y, - 2 Pi, 2 Pi}]

http://boxen.math.washington.edu/home/kirkby/Plot3D-in-Mathematica-of-sqrt-sin-x-sin-y.png

which is a lot more aesthetically pleasing, with the false color, but
has a quite different shape too.

I must admit I can't understand the difference between them. I have
some difficulty visualising in my mind what this should look lke.
Clearly the product sin(x) sin(y) will be negative for some values of
x and y, so when the square root is taken, one will get a complex
number, which I assume neither package plots. So I can understand why
this can't be plotted for all combinations of x and y.

However, the plot from Mathematica always falls to zero smoothly
before being cut-off. This actually seems to me more believeable than
the Sage plot, but I may be mistaken.

Yes. I think the problem is that in Sage, we do not try to break up plotting triangles to find out the actual boundaries of a domain. Instead, we just try to plot the triangle that goes across the domain boundary, find that one corner of the triangle is off the domain, and so we don't plot the triangle.

In this case, I think the result doesn't look *too* bad, though it is incorrect. In other cases, it leads to a very jagged figure where the domain stops.

Try:

y=var('y')
B=plot3d(sqrt(sin(x)*sin(y)),(x,-2*pi,2*pi),(y,-2*pi,2*pi),viewer='tachyon',plot_points=400)
B.show()

to make those triangles at the edge of the domain smaller.

By the way, in an effort to make this plot look better, I did notice a bug:

B=plot3d(sqrt(sin(x)*sin(y)),(x,-2*pi,2*pi),(y,-2*pi,2*pi),viewer='tachyon',adaptive=True)

gives:

ValueError: cannot convert float NaN to integer


Thanks,

Jason




--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to