diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/asymptote/examples/washermethod.asy |
Initial commit
Diffstat (limited to 'graphics/asymptote/examples/washermethod.asy')
-rw-r--r-- | graphics/asymptote/examples/washermethod.asy | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/graphics/asymptote/examples/washermethod.asy b/graphics/asymptote/examples/washermethod.asy new file mode 100644 index 0000000000..c3177aa111 --- /dev/null +++ b/graphics/asymptote/examples/washermethod.asy @@ -0,0 +1,43 @@ +import graph3; +import solids; +size(0,150); +currentprojection=perspective(0,0,11,up=Y); + +pen color1=green+opacity(0.25); +pen color2=red; +real alpha=240; + +real f(real x) {return 2x^2-x^3;} +pair F(real x) {return (x,f(x));} +triple F3(real x) {return (x,f(x),0);} + +ngraph=12; + +real x1=0.7476; +real x2=1.7787; +real x3=1.8043; + +path[] p={graph(F,x1,x2,Spline), + graph(F,0.7,x1,Spline)--graph(F,x2,x3,Spline), + graph(F,0,0.7,Spline)--graph(F,x3,2,Spline)}; + +pen[] pn=new pen[] {color1,color2,color1}; + +render render=render(compression=0); + +for(int i=0; i < p.length; ++i) { + revolution a=revolution(path3(p[i]),Y,0,alpha); + draw(surface(a),pn[i],render); + + surface s=surface(p[i]--cycle); + draw(s,pn[i],render); + draw(rotate(alpha,Y)*s,pn[i],render); +} + +draw((4/3,0,0)--F3(4/3),dashed); +xtick("$\frac{4}{3}$",(4/3,0,0)); + +xaxis3(Label("$x$",1),Arrow3); +yaxis3(Label("$y$",1),ymax=1.25,dashed,Arrow3); +arrow("$y=2x^2-x^3$",F3(1.6),X+Y,0.75cm,red); +draw(arc(1.1Y,0.3,90,0,7.5,180),Arrow3); |