Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Using same pure function for curve and surface mappings

  • To: mathgroup at smc.vnet.net
  • Subject: [mg124579] Using same pure function for curve and surface mappings
  • From: Chris Young <cy56 at comcast.net>
  • Date: Wed, 25 Jan 2012 07:06:40 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

By defining a pure function for a mapping, we can streamline the 
process of mapping curves to a surface. I'm just a little worried that 
the syntax coloring puts the "Saddle" in bright blue. Does this mean 
it's still an undefined global?

http://home.comcast.net/~cy56/Mma/CurveMapViaPureFunction.nb

http://home.comcast.net/~cy56/Mma/CurveMapViaPureFunctionPic.png

\[HorizontalLine]Saddle = (f \[Function] {f[[1]], f[[2]],
    f[[1]] * f[[2]]})

Manipulate[
 Grid [
  {
   {
    LocatorPane[
     P,

     Show[
      ParametricPlot[\[HorizontalLine]Bez[P, t], {t, 0, 1}],
      Graphics @ {Dotted, Line[P]},
      PlotRange -> 2,
      Axes -> True
      ],
     {{-2, -2}, {2, 2}, {.25, .25}}
     ],
    Show[
     ParametricPlot3D[
      \[HorizontalLine]Saddle @ {u, v}, {u, -2, 2}, {v, -2, 2},
      PlotStyle -> Opacity[opac],
      Mesh -> False
      ],
     ParametricPlot3D[
       \[HorizontalLine]Saddle @  \[HorizontalLine]Bez[P, t], {t, 0, 1}
       ]
      /.
      Line[pts_, rest___] :> Tube[pts, 0.05, rest],
     PlotRange -> 2
     ]
    }
   }
  ],
 {{P,
   {{-1, -1}, {-1, -.5}, {-1, 0}, {-1, .5}, {-1, 1},
    {  1, -1}, {   1, -.5}, {  1, 0}, {   1, .5}, {  1, 1}}}, Locator},
 {{opac, 0.75}, 0, 1}
 ]




  • Prev by Date: Re: Infinite Series Error - Bug?
  • Next by Date: Re: compile a numerical integral
  • Previous by thread: Re: Mapping a curve to a surface using Manipulate
  • Next by thread: Mapping Bezier curve to surface. Locator problem, still.