1
$\begingroup$

Would I link a slider value to a polynomial that represents the plane and draw it in the draw plane a function,

Or, is there a way that would allow me to have sliders in the draw plane function itself.

What I want to do, Is have an image of a sloped 3d plane that a can move with sliders, I want to be able to adjust the amount of slope that the plane has, the height of it, and finaly, maybe rotate it.

I want to get the value of these sliders after I have the shape of the plane that I wanted, and then use these values to calculate a "would be" sum of squares.

So something like this, how exactly would I have the plane move as I adjusted the sliders, so for example a slider labeled intercept would raise or lower the intercept of the plane.

x0 := -2;
y0 := 1;
z0 := 3;

Manipulate[F[x_, y_] := (a+slidera x0 + b+slider b y0 + c+slider b z0 - a x - b y)/c;

Plot3D[F[x, y], {x, -2, 5}, {y, -2, 10}, AxesLabel -> {x, y, z}]]
$\endgroup$
  • $\begingroup$ At the moment your question seems to be too broad amd somewhat unclear, please clarify. It would also be good to show previous efforts/code. $\endgroup$ – Yves Klett Jan 6 '15 at 13:30
  • $\begingroup$ You might start by drawing a single plane with Plot3D. From there you can identify, in your function, the parameters that you would like to vary. Each can then be associated with a slider. $\endgroup$ – DavidC Jan 6 '15 at 13:35
2
$\begingroup$

Perhaps something like:

f[a_, b_, c_][x_, y_] := a + {b, c}.{x, y};
disp = {{1, 1, 0}, {1, -1, 0}, {-1, -1, 0}, {-1, 1, 0}};

Manipulate[With[{p1 = {px, py, f[a, b, c][px, py]}, p0 = {px, py, pz}},
   Show[ParametricPlot3D[{x, y, f[a, b, c][x, y]}, {x, -10, 10}, {y, -10, 10},
    MeshFunctions -> {#1 &, #2 &}, Mesh -> {{px}, {py}},
    PlotStyle -> Directive[{Blue, Opacity[.7]}], AxesLabel -> {"x", "y", "z"},
    BoxRatios -> 1, PlotRange -> {{-10, 10}, {-10, 10}, {-10, 10}}], 
   Graphics3D[{Red, Sphere[{p0, p1}, .3], Opacity[.5], Pink, 
     Polygon[{p0, p1, {p1[[1]], p1[[2]] + Abs[p1[[3]] - pz], p1[[3]]},
       {p1[[1]], p1[[2]] + Abs[p1[[3]] - pz], pz}}],
     Polygon[{px, py, -10} + Abs[(pz - p1[[3]])/2] # & /@ disp], 
     Opacity[1], Black, Text[Style[Round[(p1[[3]] - pz)^2, .01], 14, Bold], {px, py, -10}]}], 
   Lighting -> "Neutral", 
   PlotLabel -> Style["Squared Error = "<>ToString@Round[(p1[[3]] -pz)^2, .01], 20, "Panel"]]],
 Grid[{{Style["Point Coordinates", 16, "Panel"], Spacer[5], Style["Parameters", 16, "Panel"]}, 
    {Control@{{px, -2}, -10, 10}, Spacer[5], Control@{{a, 0}, 0, 5}}, 
    {Control@{{py, 1}, -10, 10},  Spacer[5], Control@{{b, 0}, -1, 1}},
    {Control@{{pz, 5}, -10, 10},  Spacer[5], Control@{{c, 0}, -1, 1}}}],
 Alignment -> Center]

enter image description here

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.