# Variable parameter range in parametric_plot3d?

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))


Thanks!

edit retag close merge delete

Sort by ยป oldest newest most voted

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))


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))


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))


more

Thanks, Niles. I'm kicking myself now.

( 2012-03-27 05:34:09 -0500 )edit