\begin{align} \mathbf{F}(x,y) = x \mathbf{i} + y \mathbf{j} \end{align}
In mathematics there is an important distinction made between scalars (quantities represented by a number - such as mass and speed) and vectors which have both a magnitude and direction (such as weight and velocity), as a result vectors are the perfect mathematical objects for modelling real-world forces in physics. A vector field is simply a function takes points (in 2 or 3 dimensions) as inputs and returns vectors (in 2 or 3 dimensions) as outputs.
I created this visualization during my time lecturing vector calculus at UCSD. I noticed that students often had a difficult time connecting the abstract way vector field functions are represented to the effect the vector field would have on objects. Allowing students to actually see the results of the vector field itself increased student engagement with the mathematics they were studying.
An invisible grid of squares is constructed and vector forces are calculated for each grid position. Many particles are then created in random locations and are acted upon by the vector forces in their immediate vicinity. By updating each particle's position (subject to their local force) and tracing the resulting path we can visualize the flow lines of the vector field.
Click options above to experiment with some visual parameters of the simulation