3
$\begingroup$

StreamPlot3D are rather difficult to decipher. Is there a simple way to obtain the projection of such a plot onto a given plane? Ideally, I am looking for a method which does not even create the StreamPlot3D, since I am still in the process of getting the version 12.3 where this command appeared.

$\endgroup$
3
  • 4
    $\begingroup$ This sort of thing?: StreamPlot3D[{y^2, 1, x}, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}] /. {Graphics3D -> Graphics, {x_Real, y_Real, z_Real} :> {x - z, y + z}} $\endgroup$
    – Michael E2
    Jul 5 at 1:36
  • $\begingroup$ @MichaelE2 Is there a functionStreamPlot3Din newer Mathematica version? $\endgroup$ Jul 5 at 6:33
  • $\begingroup$ @UlrichNeumann Yes, StreamPlot3D is in V12.3. $\endgroup$
    – Michael E2
    Jul 6 at 20:56
3
$\begingroup$

Based on @MichaelE2's comment:

As far as I know there exists only VectorPlot3D in Mathematica v12.1

First one has to define the normal n of the plane

n={1,1,1}

The projection of an arbitrary vector v into this plane follows to v-v.n/n.n n

Now we still have to define a coordinate system e1,e2 inside the plane, examplary

e1 = (# - # . n/n . n n) &[{1, 0, 0}];
e2 = (# - # . n/n . n n) &[{0, 1, 0}];

pic=VectorPlot3D[{y^2, 1, x}, {x, -1, 1}, {y, -1,1}, {z, -1, 1}] /.   Arrow[Tube[{a_, b_}, c_]] :> Arrow[{a, b}] (*eliminate Tube*) 
pic /. {Graphics3D ->Graphics, 
{x_Real, y_Real,z_Real} :> {# . e1, # . e2} &[{x, y,z} - {x, y, z} . n/n . n n]}
 

enter image description here

$\endgroup$
6
  • $\begingroup$ @chris Thanks for your hint, now the code should run... $\endgroup$ Jul 5 at 8:23
  • 1
    $\begingroup$ You might want to keep the connectivity like this? Cases[pic /. {{x_Real, y_Real, z_Real} :> {# . e1, # . e2} &[{x, y, z} - {x, y, z} . n/n . n n]}, Line[a__, b_] -> Line[a], Infinity] // Graphics $\endgroup$
    – chris
    Jul 5 at 8:48
  • $\begingroup$ Without //Graphics Mathematica returns {} ? $\endgroup$ Jul 5 at 11:39
  • $\begingroup$ oops :this works if pic= StreamPlot3D[.... $\endgroup$
    – chris
    Jul 6 at 14:29
  • $\begingroup$ @chris Is StreamPlot3D a new function in Mathematica version>12.1? $\endgroup$ Jul 6 at 14:59

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.