1
$\begingroup$

Assuming I'm given an arbitrary 3D curve, what I'm trying to do is draw a plane (or a pair of parallel planes) given only one or two points to work with. Now, I know that 3 points are required to define a plane, but I've been trying to work around this by placing points arbitrarily close to my given points in order to draw the planes.

For example,enter image description here

enter image description here

This is an example of something I am trying to do. Given only two points, I was able to draw a plane that appeared perpendicular to the structure above the plane. Of course, this was simply a semicircle that had its endpoints in the XY plane, so it was very easy to do. Let's say I had something more complicated such as this function ParametricPlot3D[{t, t, t^3}, {t, -2, 2}, Axes -> False, Boxed -> False]

I'd like to draw planes at the endpoints of the curve that appear to be parallel. enter image description here

Edit: Just like this, except where the black lines are actual 3D planes

enter image description here

$\endgroup$
  • $\begingroup$ Your problem is mathematically ill-defined and hence cannot be solved. For example, in your final example, why did you make the lines ("planes") both horizontal? You added that arbitrary constraint. $\endgroup$ – David G. Stork Feb 9 at 23:30
  • $\begingroup$ Yes, the issue is precisely that it is mathematically ill-defined. But, what I can do is dance around this issue by, say, picking extra points in order to define a plane and then manipulate the chosen points in such a way that I can "rotate" the plane by inspection in a more elegant way than simply just randomly picking points. I'm assuming this might be able to be done using Manipulate. $\endgroup$ – Ztan Feb 9 at 23:43
1
$\begingroup$

To pick two parallel planes (out of infinitely many), you can

  1. Pick a random direction and
  2. use this direction to construct two InfinitePlanes passing through the two points on the curve:

{pnt1, pnt2} = {{-2, -2, (-2)^3}, {2, 2, 2^3}};
SeedRandom[77777]
randomdir = RandomReal[{-2, 2}, {2, 3}]

{{0.262081, -1.50893, 0.331108}, {-0.523886, 0.100094, 0.71017}}

Show[ParametricPlot3D[{t, t, t^3}, {t, -2, 2}], 
 Graphics3D[{{Green, Sphere[{pnt1, pnt2}, .3], 
    Opacity[.5], Red, EdgeForm[], InfinitePlane[pnt1, randomdir], 
    Blue, InfinitePlane[pnt2, randomdir]}}], PlotRange -> All, 
 Lighting -> "Neutral", Axes -> False, Boxed -> False, Method -> {"ShrinkWrap" -> True}]

enter image description here

To pick a random plane passing through the two points, you can use InfinitePlane by appending a random third point to the two points:

Show[ParametricPlot3D[{t, t, t^3}, {t, -2, 2}], 
 Graphics3D[{{Green, Sphere[{pnt1, pnt2}, .3], Opacity[.5], Red, 
    EdgeForm[], InfinitePlane[{pnt1, pnt2, randomdir[[1]]}]}}], 
 PlotRange -> All, Lighting -> "Neutral", Axes -> False, 
 Boxed -> False, Method -> {"ShrinkWrap" -> True}]

enter image description here

$\endgroup$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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