Ticket #1877: trac_1877.patch
| File trac_1877.patch, 2.5 kB (added by jwmerrill, 4 months ago) |
|---|
-
a/sage/plot/plot3d/parametric_plot3d.py
old new 336 336 sage: fz = -u + (2*0.84*cosh(0.4*u)*sinh(0.4*u))/(0.4*((sqrt(0.84)*cosh(0.4*u))^2 + (0.4*sin(sqrt(0.84)*v))^2)) 337 337 sage: parametric_plot3d([fx, fy, fz], (u, -13.2, 13.2), (v, -37.4, 37.4), plot_points = [90,90], frame=False, color="green") 338 338 339 TESTS: 340 341 sage: u, v = var('u,v') 342 sage: plot3d(u^2-v^2, (u, -1, 1), (u, -1, 1)) 343 Traceback (most recent call last): 344 ... 345 ValueError: Plot variables should be distinct, but both are u. 339 346 """ 340 347 # TODO: 341 348 # * Surface -- behavior of functions not defined everywhere -- see note above … … 366 373 plot_points = 75 367 374 G = parametric_plot3d_curve(f, urange, plot_points, **kwds) 368 375 else: 376 if urange[0] is vrange[0]: 377 raise ValueError, "Plot variables should be distinct, but both are %s."%urange[0] 378 369 379 if plot_points == "automatic": 370 380 plot_points = [40,40] 371 381 G = parametric_plot3d_surface(f, urange, vrange, plot_points, **kwds) -
a/sage/plot/plot3d/plot3d.py
old new 128 128 Hill and valley (flat surface with a bump and a dent): 129 129 sage: x, y = var('x y') 130 130 sage: plot3d( 4*x*exp(-x^2-y^2), (x,-2,2), (y,-2,2)) 131 132 TESTS: 133 Listing the same plot variable twice gives an error. 134 sage: x, y = var('x y') 135 sage: plot3d( 4*x*exp(-x^2-y^2), (x,-2,2), (x,-2,2)) 136 Traceback (most recent call last): 137 ... 138 ValueError: Plot variables should be distinct, but both are x. 131 139 """ 132 140 if len(urange) == 2: 133 141 try: … … 140 148 else: 141 149 u = urange[0] 142 150 v = vrange[0] 151 if u is v: 152 raise ValueError, "Plot variables should be distinct, but both are %s."%u 153 143 154 w = (u, v, f) 144 155 145 156 if adaptive: