Vector fields are found in many apsects of physics, but they also form the basis of some great math art. One well-known vector field are the magnetic field lines formed around a magnet. Many of us did this experiment in school, where iron filings on a piece of paper are moved around by a magnet underneath, as shown in this image¹.

This is a physical vector field, which can be described using a mathematical transformation, a simple equation that takes an (x, y) coordinate and returns a modified (x, y) coordinate.

Start with a very basic vector transformation:

x ↦ x + 0.5

y ↦ y + 0.5

Each point just moves up and to the right by 0.5 units.

(In this notation, ↦ is the "maps to" operator. The current x and y values map to new x and y values.)

To make math art, we need something more interesting. Sine and cosine functions usually work well, and give chaotic (interesting) results. Here is an example:

x ↦ x - 0.4 sin(y + sin(0.4y))

y ↦ y - 0.4 sin(x + sin(-2x))

Now that we have a nice vector field, let's see what happens to a single point that moves through the field. Here are 25 iterations of the starting point (0, 2).

This can generate some fun curves, but sometimes we want more than a single curve for math art purposes. Let's try plotting several curves over a range initial starting points. Here, we plot 10 points evenly spaced around the circle (x-2)² + (y-1)² = 2².

It's interesting, but 10 points isn't enough. Try plotting 10,000 or more points evenly spaced around the circle. Make each line slightly transparent so the different paths blend together a bit, and fade the color from one color at the start of the line to another color the end. Now we've got something fun!

Click here to see more vector field images

If you're in to animations, a final step is to change some parameter of the image for each frame of the animation. Here, the vector field stays constant, while the initial circle moves left to right.

Vector Field Animation- Newton Henry Black, Harvey N. Davis (1913) Practical Physics.

Copyright © 2024 codeismycanvas.art