maple - Shade Bounded Region along y-axis -
i plotted line want shade area between 2 , 4 along y axis illustrate area under curve cannot figure out how that, can help? code, rather simple
>y:=(2*x); >plot(y,x=0..3);
i find difficult understand region have in mind.
is this?
restart; y := 2*x: plots:-display( plot(2*x, x=0..3), plots:-inequal([y>=y, y>=2, y<=4], x=0..3, y=0..6, 'nolines', 'color'="burgundy") ); of course omit curve (line) y=2*x by removing call plot above.
if have other region in mind should able adjust call plots:-inequal accordingly.
there other ways accomplish such things, such calling plot filled option. can use plottools:-reflect, or use parametric calling sequence of plot, flip x , y axes.
i figure might wanting avoid having "solve x", x values corresponding y=2 , y=4 (even though in example of y=2*x can in head).
these reasons why think you'd likley find easiest use plots:-inequal.
[edit: followup comment 8 rectangles]
first, different example, more clarity.
restart; x:=arcsin(y/6): p := plots:-display( plot(x, y=2..5), plots:-inequal([x<=x], y=2..5, x=0..1.2, 'nolines', 'color'=pink) ): plots:-display( plot(2, color=black, linestyle=dot), plot(5, color=black, linestyle=dot), plot([x, y, y=0..6]), plottools:-transform((x,y)->[y,x])(p), view=[0..1.2,0..6], labels=["x","y"], size=[500,300] ); the upper of lower sums (using rectangles) can visualized using riemannsum command student:-calculus1 package. (or use seq command , construct them formulas corners -- seems lot of awkward bookkeeping.)
you can of course remove of parts passed below plots:-display command.
restart; with(student:-calculus1): x:=arcsin(y/6): p:=riemannsum(x, y=2..5, method = upper, output = plot, partition=8, boxoptions=[filled=[color=pink,transparency=.5]], caption=""): rp:=plottools:-transform((x,y)->[y,x])(p): plots:-display( plot(2, color=black, linestyle=dot), plot(5, color=black, linestyle=dot), plot([x, y, y=0..6]), rp, view=[0..1.2,0..6], labels=["x","y"], size=[500,300] ); restart; with(student:-calculus1): x:=arcsin(y/6): p:=riemannsum(x, y=2..5, method = lower, output = plot, partition=8, boxoptions=[filled=[color=pink,transparency=.5]], caption=""): rp:=plottools:-transform((x,y)->[y,x])(p): plots:-display( plot(2, color=black, linestyle=dot), plot(5, color=black, linestyle=dot), plot([x, y, y=0..6]), rp, view=[0..1.2,0..6], labels=["x","y"], size=[500,300] ); all these examples little less complicated if wanted area between curve , x-axis instead.





Comments
Post a Comment