[Date Index]
[Thread Index]
[Author Index]
Re: ParametricPlot3D
*To*: mathgroup at smc.vnet.net
*Subject*: [mg61717] Re: [mg61693] ParametricPlot3D
*From*: Igor Antonio <igora at wolf-ram.com>
*Date*: Thu, 27 Oct 2005 05:01:44 -0400 (EDT)
*Organization*: Wolfram Research, Inc.
*References*: <200510250528.BAA23561@smc.vnet.net> <200510260501.BAA18802@smc.vnet.net>
*Reply-to*: igora at wolf-ram.com
*Sender*: owner-wri-mathgroup at wolfram.com
Maurits Haverkort wrote:
> Dear all
>
> I want to plot several surfaces in one plot and used for that
> ParametricPlot3D. Everything works fine if I enter the definitions for the
> functions inline. If I define however a variable (list) that holds the
> different functions it does not work anymore. Does anybody know a way out?
>
> The functions I want to plot are for example two spherse of unit radia
> centered at 000 and 100. (I need in the end to plot funcitons (R[t,f]
> centered at different orrigens)
>
> If I write it inline it works fine
> ParametricPlot3D[{{Cos[f] Sin[t], Sin[t] Sin[f], Cos[t]}, {Cos[f] Sin[t] +
> 1, Sin[t] Sin[f], Cos[t]}}, {t, 0, 3.1415}, {f, 0, 2 3.1415}];
>
> If however I first define my functions and then try to plot:
> ToPlot = {{Cos[f] Sin[t], Sin[t] Sin[f], Cos[t]}, {Cos[f] Sin[t] + 1, Sin[t]
> Sin[f], Cos[t]}};
> ParametricPlot3D[ToPlot, {t, 0, 3.1415}, {f, 0, 2 3.1415}];
> I get the error:
> ParametricPlot3D::ppfun : Argument ToPlot is not a list with three or four
> elements. More.
>
> Since the function I need to plot is a result of a calculation I rather need
> to input it as a variable. Any sugestions?
>
> Thanks,
> Maurits
Maurits,
ParametricPlot3D has the Attribute HoldAll, which means it any of its arguments
before launching:
Mathematica 5.2 for Microsoft Windows
Copyright 1988-2005 Wolfram Research, Inc.
-- Terminal graphics initialized --
In[1]:= Attributes@ParametricPlot3D
Out[1]= {HoldAll, Protected}
You need to do an Evaluate[] on the argument of ParametricPlot3D so that ToPlot
is "converted" to its values before being passed to ParametricPlot3D, like this:
ToPlot = {{Cos[f], Sin[t], Sin[t] Sin[f], Cos[t]}, {Cos[f] Sin[t] + 1, Sin[t]
Sin[f], Cos[t]}};
ParametricPlot3D[Evaluate@ToPlot, {t, 0, 3.1415}, {f, 0, 2 3.1415}];
--
Igor C. Antonio
Wolfram Research, Inc.
http://www.wolfram.com
To email me personally, remove the dash.
Prev by Date:
**Re: Re: Language vs. Library why it matters**
Next by Date:
**Re: MLPutRealList vs. sequence of MLPutDouble**
Previous by thread:
**Re: ParametricPlot3D**
Next by thread:
**Re: ParametricPlot3D**
| |