# Plotting vector fields

I just started using Mathematica and I don't know how to plot these vector fields as streamlines,

I looked up the VectorPlot3D function but really don't know how to apply it. If there is another better way to do it please say so, I'm really new.

• Try u[x_, y_, z_] := 1/(x^2 + y^2 + z^2)^(3/2) {-y, x, z} and then VectorPlot3D[u[x, y, z], {x, -1, 1}, {y, -1, 1}, {z, -1, 1}]. For pseudo-3D streamlines, look at the bottom of the Applications part of the help for StreamPlot. Or you might want to consider using NDSolve to get a few numerical solutions and then plotting them. Nov 12, 2017 at 12:29

The first one is easy with VectorPlot3D:

u = {-y, x, z}/Norm[{x, y, z}]^3
VectorPlot3D[u, {x, -.1, .1}, {y, -.1, .1}, {z, -.1, .1},
VectorScale -> {Large, Scaled[0.5]}, VectorPoints -> {4, 10, 7}]


For the second and the third, I made a coordinate transformation of your fields and used VectorPlot3D:

v = TransformedField["Spherical" -> "Cartesian", {Cos[\[Theta]] Sin[\[CurlyPhi]]/r^2, Cos[\[CurlyPhi]],0}, {r, \[Theta], \[CurlyPhi]} -> {x, y, z}];

VectorPlot3D[v, {x, -.1, .1}, {y, -.1, .1}, {z, -.1, .1},
VectorScale -> {Large, Scaled[0.5]}, VectorPoints -> {4, 10, 7}]

W = TransformedField["Cylindrical" -> "Cartesian", {r/(z^2 + r^2 + r^2 Sin[\[Theta]]^2)^(3/2),
z/(z^2 + r^2 + r^2 Sin[\[Theta]]^2)^(3/2),
r Sin[\[Theta]]/(z^2 + r^2 + r^2 Sin[\[Theta]]^2)^(3/2)}, {r, \[Theta], z} -> {x, y, h}];

VectorPlot3D[W, {x, -.1, .1}, {y, -.1, .1}, {h, -.1, .1},
VectorScale -> {Large, Scaled[0.5]}, VectorPoints -> {4, 10, 7}]