Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Module and Manipulate Oddity

  • To: mathgroup at smc.vnet.net
  • Subject: [mg85874] Re: Module and Manipulate Oddity
  • From: dh <dh at metrohm.ch>
  • Date: Tue, 26 Feb 2008 07:46:41 -0500 (EST)
  • References: <fpoorf$1ht$1@smc.vnet.net>


Hi,

in the first case the execution of cube=.. is defered until a and u 

have a value. On the other hand, the second case executes cube=.. as 

soon as it is defined and at this time a and u do not have a value.

hope this helps, Daniel



travelmail26 at gmail.com wrote:

> When I use the "Module" function, I can combine the graphics with

> manipulate. Without module, I get an error saying the coordinates need

> to be in triplet or scaled form. Why does "Module" have any effect on

> this?

> 

> 

> Line 1:

> 

> sh[a_, u_] := Module[{cube, sp1} ,

>   cube = Graphics3D[Cuboid[{u, a, u}], PlotRange -> 5];

>   sp1 = Graphics3D[Sphere[{u, a, u}], PlotRange -> 5];

>   Show[cube, sp1]]

> 

> Line 2: Manipulate[sh[a, u], {a, 0, 2}, {u, 0, 2}]

> 

> ******************************

> And, without module:

> 

> sh[a_, u_] := cube = Graphics3D[Cuboid[{u, a, u}], PlotRange -> 5];

> sp1 = Graphics3D[Sphere[{u, a, u}], PlotRange -> 5];

> Show[cube, sp1]

> 

> Manipulate[sh[a, u], {a, 0, 2}, {u, 0, 2}]

> 




  • Prev by Date: Re: Re: "Assuming"
  • Next by Date: Re: Dynamic Rotation: Coupling of Two or More Graphics3D objects?
  • Previous by thread: Re: Module and Manipulate Oddity
  • Next by thread: PowerExpand in version 6