I've just started using SageMath today, and I've been pleasantly surprised at how good it is. I've been working through tutorials and playing around with plotting functions without any major problems until I wrote a series of nested for-loops using range values.
I'm getting the error 'ValueError("plot start point and end point must be different")', but only when the outer loop uses 'for r1 in range(3,6)', not when I do exactly the same thing using 'for r1 in [3..5]'.
Am I doing something newbie-naive here, or is this a bug?
Here's the full script:
t = var('t')
g = Graphics()
for r1 in [3..5]: # This works as expected
#for r1 in range(3,6): # This produces error: File "/usr/lib/sagemath/local/lib/python2.7/site-packages/sage/plot/misc.py", line 136, in setup_for_eval_on_grid raise ValueError("plot start point and end point must be different")
g = g + circle((0, 0), r1, rgbcolor=(0.5,0.5,0.5))
for r2 in range(1, r1):
f = floor((r1 + r2) / 2)
for d in range(1, f):
print "r1 =",r1, " r2 =", r2, " d =",d; # debug msg
g = g + parametric_plot(((r1 - r2) * cos(t) + d * cos((r1 - r2) * t / r2), (r1 - r2) * sin(t) - d * sin((r1 - r2) * t / r2)), (t, 0, r2 / r1 * (pi ^ pi)), rgbcolor=(r2/r1, d / f, 0.5))
g.show()