Message Boards Message Boards

0
|
3100 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How can I get this ParametricPlot3D to use a 2D Slider to control it?

I have been having an issue getting a slider to control this equation. I would like a 2D Slider that moves from ymin to ymax on the vertical and xmin to xmax on the horizontal. Most likely the ranges from min to max on both of these will be -5 to 5 or so.

Can you take a look at what I have to see how I could improve it?

f[u_, v_] = {u - (u^3/3) + u v^2, v - (v^3/3) + u^2 v, u^2 - v^2};

Manipulate[
 ParametricPlot3D[f[u, v], {u, xmin, xmax}, {v, ymin, ymax}, 
  MeshStyle -> Thickness[0.001], 
  BoundaryStyle -> Directive[Black, Thickness[0.004]], 
  PlotPoints -> 25, ColorFunction -> "BlueGreenYellow", 
  ImageSize -> 800, AxesLabel -> {x, y, z}, PlotRange -> {All, All}, 
  LabelStyle -> Directive[Black, Medium, Bold]], {{xmin, -2}, -5, -1, 
  1}, Dynamic[xmin], {{xmax, 2}, 1, 5, 1}, 
 Dynamic[xmax], {{ymin, -2}, -5, -1, 1}, 
 Dynamic[ymin], {{ymax, 2}, 1, 5, 1}, Dynamic[ymax]]
Attachments:
POSTED BY: Michael Harcrow
3 Replies

You might also consider using IntervalSlider.

http://reference.wolfram.com/language/ref/IntervalSlider.html

POSTED BY: Sean Clarke

I would do it with DynamicModule:

DynamicModule[{p = {-1, -1}, q = {2, 2}},
 Row[{LocatorPane[Dynamic[{p, q}],
    Graphics[{Gray, Dynamic@Rectangle[p, q]},
     PlotRange -> {{-2, 5}, {-2, 5}}, Frame -> True]],
   Dynamic@
    With[{xmin = p[[1]], xmax = q[[1]], ymin = p[[2]], 
      ymax = q[[2]]},
     ParametricPlot3D[f[u, v], {u, xmin, xmax}, {v, ymin, ymax}]]}]]
POSTED BY: Gianluca Gorni

This does work pretty well. However I would like to move it to just have one moving piece in the locator instead of two. Either way this will do. Thank you for your help!

POSTED BY: Michael Harcrow
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract