Ask Your Question

filling in an area under a function or curve in 3 dimensions

asked 2012-08-19 08:44:48 -0500

anonymous user


I am new to Sage, and I couldn't find an answer to two question in the documentation. First, how do I get sage to plot a parametric curve in 3 dimensions, and then fill in the area between the curve and the xy-plane (i.e., I want sage to drop down a "sheet" from the curve to the xy-plane)? Similarly, how do I get Sage to plot a function in 3 dimensions (say, $f(x,y)=x^2y+10)$), and tell sage to fill in the volume under the graph between the function and the xy-plane? So for the function $f$ just mentioned, I would like the volume under the curve filled in over the rectangle $1 \leq x \leq 3$, $0 \leq y \leq 5$. How do I do that? Thanks!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-08-19 11:01:02 -0500

achrzesz gravatar image

updated 2012-08-19 19:34:46 -0500

In the case of 3d curve you can try something like:

var('t u')
p2=sum([line([(cos(t),sin(t),0),(cos(t),sin(t),t^2)]) for t in srange(-1,1,0.02)]) 

In the case of 3d surface:

var('x y')
p1=sum([line([(t,0,0),(t,0,f(t,0))]) for t in srange(1,3,0.02)]) 
p2=sum([line([(3,u,0),(3,u,f(3,u))]) for u in srange(0,5,0.1)]) 
edit flag offensive delete link more


Thanks for the help.

strangelove1221 gravatar imagestrangelove1221 ( 2012-08-19 14:19:49 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-08-19 08:44:48 -0500

Seen: 916 times

Last updated: Aug 19 '12