Ask Your Question

Variable parameter range in parametric_plot3d?

asked 2012-03-26 23:20:20 +0100

Bill gravatar image

Is it possible to give parametric_plot3d parameter ranges where one parameter is a function of the other? For example, I would like the following command to execute and create a plot of a triangle in $\mathbb{R}^3$.

v = some vector
w = some other vector
someTriangle = parametric_plot3d(t*v + s*w, (t,0,1-s), (s,0,1))


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-03-27 09:24:16 +0100

niles gravatar image

Try this:

someTriangle = parametric_plot3d(t*(1-s)*v + s*w, (t,0,1), (s,0,1))

In general, if you want t to be in the interval [a(s), b(s)], just use t' = a(s) + t*(b(s) - a(s)) and let t range from 0 to 1. For example, to graph the function f(s,t) = 1 for s in [0,1] and t in [s^2, s]:

sage: var('s,t')
(s, t)
sage: parametric_plot3d([s,(s^2 + t*(s - s^2)),1], (t,0,1), (s,0,1))

image description

And here's a more complicated example:

sage: var('s,t,x,y')
(s, t, x, y)
sage: f = sin(x)*cos(y)
sage: tprime = s^2 + t*(s - s^2)

The rectangular plot:

sage: parametric_plot3d([s,t,f(x=s,y=t)], (t,0,1), (s,0,1))

image description

Change coordinates to plot only a part of the t range:

sage: parametric_plot3d([s,tprime,f(x=s,y=tprime)], (t,0,1), (s,0,1))

image description

edit flag offensive delete link more


Thanks, Niles. I'm kicking myself now.

Bill gravatar imageBill ( 2012-03-27 12:34:09 +0100 )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-03-26 23:20:20 +0100

Seen: 358 times

Last updated: Mar 27 '12