Scalar fields and vector fieldsA scalar field is a function that assigns a number to every position in space. Temperature, pressure, density, molecular concentration, charge density, and potential energy are scalar fields. A vector field is a function that assigns a vector to every position in space. Electric fields, magnetic fields, thermal gradients, concentration gradients, and pressure gradients are vector fields. Below the cross sections of a scalar field and a vector field are shown. The view is looking in the $-z$-direction at the $x-y$ plane. Different values of $z$ can be selected. In the vector field plot the length a vector at every point is given in by its transparency. The black vectors have the largest magnitude and the transparent vectors have the smallest magnitude. The arrows show the components of the vector in the $x-y$ plane. If the arrow is short and black, that vector is pointing mostly out of the $x-y$ plane. If the vector is pointing out of the screen, $\odot$ is displayed. If the vector is pointing into the screen, $\otimes$ is displayed. Some interesting fields can be displayed by pressing the buttons below. It is also possible to define your own scalar field or vector field by placing a mathematical expression into the text boxes and pressing the corresponding 'Calculate' button. The gradient of a scalar field is a vector field. The $\nabla f \rightarrow \vec{A}$ button plots the gradient of the scalar field $f(x,y,z)$ that is defined on the left. When the gradient is taken of a scalar field, the arrows of the vector field are perpendicular to the lines of constant value in the scalar field plot. |