4
$\begingroup$

Surface

z = 2 x^3 - 5 y^4

Plane

z = x + y + 5

Plot

enter image description here

A curve is formed by the intersection of the surface and the plane. I would like to add a point to the plot that can be moved by the user along the curve of intersection.


Thanks!!!

to work animation, i had to change line

anim = Table[ Show[p3D, Graphics3D[{PointSize[0.02], Point[par[j]]}], ViewPoint -> {-1, -1, 1}], {j, -10, 10, 0.1}];

to:

Animate[Show[p3D,Graphics3D[{PointSize[0.02],Point[par[j]]}],ViewPoint->{-1,-1,1}],{j,-10,10,0.1}]

But where is equation of motion of the material point in this solution?

$\endgroup$
  • $\begingroup$ And have you looked up the documentation page for Manipulate? $\endgroup$ – march Jun 14 '16 at 22:46
  • 1
    $\begingroup$ Fully agree with @march. Try to use Solve to figure out the function of crossing, then use Manipulate to show it. $\endgroup$ – Wjx Jun 14 '16 at 23:33
  • $\begingroup$ You can format inline code and code blocks by selecting the code and clicking the {} button above the edit window. The edit window help button ? is also useful for learning how to format your questions and answers. You may also find this meta Q&A helpful $\endgroup$ – Michael E2 Jun 18 '16 at 22:27
9
$\begingroup$

You can use MeshFunctions to visualize the intersection. The following is one way to parametrize curve.

f[x_, y_] := 2 x^3 - 5 y^4;
p[x_, y_] := x + y + 5;
expr = x /. Quiet[First@Solve[f[x, y] == p[x, y], {x, y}, Reals]];
t[u_] := expr /. y -> u;
par[w_] := {t[w], w, p[t[w], w]};
p3D = Plot3D[{f[x, y], p[x, y]}, {x, -20, 20}, {y, -10, 10}, 
   MeshFunctions -> (f[#1, #2] - p[#1, #2] &), Mesh -> {{0}}, 
   MeshStyle -> {Red, Thick}, PlotStyle -> Opacity[0.5]];
anim = Table[
   Show[p3D, Graphics3D[{PointSize[0.02], Point[par[j]]}], 
    ViewPoint -> {-1, -1, 1}], {j, -10, 10, 0.1}];

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.