Ticket #7008: trac-7008-doctests.patch

File trac-7008-doctests.patch, 5.4 KB (added by jason, 10 years ago)

apply on top of previous patch

• doc/en/tutorial/tour_algebra.rst

```# HG changeset patch
# User Jason Grout <jason-sage@creativetrax.com>
# Date 1254204343 18000
# Node ID 6f79e87ccc86545e1607757e5c9a6c36ff0dc61b
# Parent  db6a447a5c84a3fca211833dc605e7304ef557b6
Fix doctests broken by #7008

diff -r db6a447a5c84 -r 6f79e87ccc86 doc/en/tutorial/tour_algebra.rst```
 a sage: t = var('t') sage: P = parametric_plot((cos(2*t) + 2*cos(t), 4*cos(t) - cos(2*t) ),\ ...   0, 2*pi, rgbcolor=hue(0.9)) ...   (t, 0, 2*pi), rgbcolor=hue(0.9)) sage: show(P) The individual components can be plotted using :: sage: t = var('t') sage: p1 = plot(cos(2*t) + 2*cos(t), 0, 2*pi, rgbcolor=hue(0.3)) sage: p2 = plot(4*cos(t) - cos(2*t), 0, 2*pi, rgbcolor=hue(0.6)) sage: p1 = plot(cos(2*t) + 2*cos(t), (t,0, 2*pi), rgbcolor=hue(0.3)) sage: p2 = plot(4*cos(t) - cos(2*t), (t,0, 2*pi), rgbcolor=hue(0.6)) sage: show(p1 + p2) (For more on plotting, see :ref:`section-plot`.)
• doc/en/tutorial/tour_plotting.rst

`diff -r db6a447a5c84 -r 6f79e87ccc86 doc/en/tutorial/tour_plotting.rst`
 a :: sage: x = var('x') sage: parametric_plot((cos(x),sin(x)^3),0,2*pi,rgbcolor=hue(0.6)) sage: parametric_plot((cos(x),sin(x)^3),(x,0,2*pi),rgbcolor=hue(0.6)) You can combine several plots by adding them: :: sage: x = var('x') sage: p1 = parametric_plot((cos(x),sin(x)),0,2*pi,rgbcolor=hue(0.2)) sage: p2 = parametric_plot((cos(x),sin(x)^2),0,2*pi,rgbcolor=hue(0.4)) sage: p3 = parametric_plot((cos(x),sin(x)^3),0,2*pi,rgbcolor=hue(0.6)) sage: p1 = parametric_plot((cos(x),sin(x)),(x,0,2*pi),rgbcolor=hue(0.2)) sage: p2 = parametric_plot((cos(x),sin(x)^2),(x,0,2*pi),rgbcolor=hue(0.4)) sage: p3 = parametric_plot((cos(x),sin(x)^3),(x,0,2*pi),rgbcolor=hue(0.6)) sage: show(p1+p2+p3, axes=false) A good way to produce filled-in shapes is to produce a list of :: sage: x, y, z = var('x, y, z') sage: implicit_plot3d(x^2 + y^2 + z^2 - 4, (-2, 2), (-2, 2), (-2, 2)) sage: implicit_plot3d(x^2 + y^2 + z^2 - 4, (x,-2, 2), (y,-2, 2), (z,-2, 2)) Here are some more examples:
• doc/fr/tutorial/tour_algebra.rst

`diff -r db6a447a5c84 -r 6f79e87ccc86 doc/fr/tutorial/tour_algebra.rst`
 a sage: t = var('t') sage: P = parametric_plot((cos(2*t) + 2*cos(t), 4*cos(t) - cos(2*t) ),\ ...   0, 2*pi, rgbcolor=hue(0.9)) ...   (t, 0, 2*pi), rgbcolor=hue(0.9)) sage: show(P) Les coordonnées individuelles peuvent être tracées en utilisant :: sage: t = var('t') sage: p1 = plot(cos(2*t) + 2*cos(t), 0, 2*pi, rgbcolor=hue(0.3)) sage: p2 = plot(4*cos(t) - cos(2*t), 0, 2*pi, rgbcolor=hue(0.6)) sage: p1 = plot(cos(2*t) + 2*cos(t), (t, 0, 2*pi), rgbcolor=hue(0.3)) sage: p2 = plot(4*cos(t) - cos(2*t), (t, 0, 2*pi), rgbcolor=hue(0.6)) sage: show(p1 + p2) (Pour plus d'information sur le tracé de graphe, voir :ref:`section-plot`.)
• doc/fr/tutorial/tour_plotting.rst

`diff -r db6a447a5c84 -r 6f79e87ccc86 doc/fr/tutorial/tour_plotting.rst`
 a :: sage: x = var('x') sage: parametric_plot((cos(x),sin(x)^3),0,2*pi,rgbcolor=hue(0.6)) sage: parametric_plot((cos(x),sin(x)^3),(x,0,2*pi),rgbcolor=hue(0.6)) Différents graphiques peuvent se combiner sur une même image : :: sage: x = var('x') sage: p1 = parametric_plot((cos(x),sin(x)),0,2*pi,rgbcolor=hue(0.2)) sage: p2 = parametric_plot((cos(x),sin(x)^2),0,2*pi,rgbcolor=hue(0.4)) sage: p3 = parametric_plot((cos(x),sin(x)^3),0,2*pi,rgbcolor=hue(0.6)) sage: p1 = parametric_plot((cos(x),sin(x)),(x,0,2*pi),rgbcolor=hue(0.2)) sage: p2 = parametric_plot((cos(x),sin(x)^2),(x,0,2*pi),rgbcolor=hue(0.4)) sage: p3 = parametric_plot((cos(x),sin(x)^3),(x,0,2*pi),rgbcolor=hue(0.6)) sage: show(p1+p2+p3, axes=false) Une manière commode de tracer des formes pleines est de préparer une
• sage/calculus/desolvers.py

`diff -r db6a447a5c84 -r 6f79e87ccc86 sage/calculus/desolvers.py`
 a sage: sol = desolve_system([de1, de2], [x,y], ics=[0,1,2]); sol [x(t) == -sin(t) + 1, y(t) == cos(t) + 1] sage: solnx, solny = sol[0].rhs(), sol[1].rhs() sage: plot([solnx,solny],0,1) sage: parametric_plot((solnx,solny),0,1) sage: plot([solnx,solny],(0,1)) sage: parametric_plot((solnx,solny),(0,1)) AUTHOR: Robert Bradshaw (10-2008) """ sage: solnx, solny = map(SR, soln) sage: RR(solnx(s=3)) 1.28224001611973 sage: P1 = plot([solnx,solny],0,1) sage: P2 = parametric_plot((solnx,solny),0,1) sage: P1 = plot([solnx,solny],(0,1)) sage: P2 = parametric_plot((solnx,solny),(0,1)) Now type show(P1), show(P2) to view these.