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.
1 Answer
$\begingroup$
$\endgroup$
6
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]}
-
$\begingroup$ @chris Thanks for your hint, now the code should run... $\endgroup$ Commented Jul 5, 2021 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$– chrisCommented Jul 5, 2021 at 8:48 -
$\begingroup$ Without
//Graphics
Mathematica returns{}
? $\endgroup$ Commented Jul 5, 2021 at 11:39 -
$\begingroup$ oops :this works if pic= StreamPlot3D[.... $\endgroup$– chrisCommented Jul 6, 2021 at 14:29
-
$\begingroup$ @chris Is
StreamPlot3D
a new function in Mathematica version>12.1? $\endgroup$ Commented Jul 6, 2021 at 14:59
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$StreamPlot3D
in newer Mathematica version? $\endgroup$StreamPlot3D
is in V12.3. $\endgroup$