Re: an attempt at solid modeling with Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg109873] Re: an attempt at solid modeling with Mathematica
- From: David Bailey <dave at removedbailey.co.uk>
- Date: Thu, 20 May 2010 07:24:47 -0400 (EDT)
- References: <ht0gdn$7d$1@smc.vnet.net>
Narasimham wrote:
> a=1;
> base=ParametricPlot3D[{ a Cos[u], a Sin[u], u},{u,0, 2 Pi}]
> var1=ParametricPlot3D[{ a Cos[u+v], a Sin[u+v], u},{u,0, 2 Pi},{v,0,2 Pi}]
> var2=ParametricPlot3D[{ u Cos[v], u Sin[v], u},{u,0, 2 Pi},{v,0,2 Pi}]
> var3=ParametricPlot3D[{ u Cos[v], u Sin[v], v},{u,0, 2 Pi},{v,0,2 Pi}]
> ThreeParaInto3D[u_,v_,w_]={ u Cos[v+w], u Sin[v+w], v} ;
> (* we could, so to say, say that ParametricPlot3D1, ParametricPlot3D2
> commands are available already as above, but not the next/extended
> ParametricPlot3D3 *)
>
> ParametricPlot3D3_[{u_,v_,w_} ,{u,0, 2 Pi},{v,0,2 Pi},{w,0, 2 Pi}]:=ParametricPlot3D[[ThreeParaInto3D[u,v,w], {u,0, 2 Pi},{v,0,2 Pi}],{w,0, 2 Pi}]
> ParametricPlot3D3[ThreeParaInto3D[u,v,w], {u,0, 2 Pi},{v,0,2 Pi},{w,0, 2 Pi}]
>
> The above does not work, how to write the macro ?
>
> TIA
> Regards
> Narasimham
>
At the very least, I think you should be feeding 12 arguments to your
new function (Mathematica doesn't really have macros) - three functions,
three variables, and six range limits:
ParametricPlot3D3_[{f1_,f2_,f3_} ,{u_,umin_,umax_
},{v_,vmin_,vmax_},{w_,wmin_, wmax_}]:= ...............
I'd recommend you start by defining some simple Mathematica functions,
just to build up a bit of experience. Copy/paste a few examples from the
documentation, and experiment with them for a bit.
David Bailey
http://www.dbaileyconsultancy.co.uk