Fractal geometry is one of the most elegant and beautiful branches of mathematics.

An early analysis of fractals came from a surprising and weird phenomenon that occurs when you try to measure a coastline.

The measured length of the coastline depends on how long of a ruler you use, with shorter rulers resulting in longer measured lengths.

You probably haven't thought of fractals since your high school geometry class, but there's a chance you've crossed paths with the otherworldly patterns recently. From trippy dorm room posters to the special effects in the blockbuster film "Doctor Strange," the endlessly recursive designs have become a cultural shorthand for awe and wonder.

Fractals are mathematical curves that are made up of ever smaller copies of themselves, so that zooming in on one part of the curve results in a very similar shape to the whole.

Many fractals, like the Mandelbrot set above, come from intricate mathematical equations. But some are much simpler and easier to construct.

One straightforward but still fascinating fractal is the Koch snowflake. To build your own, start with a straight line. Then, add a triangular point in the middle of that line. Take that shape and do the same thing with each of the four smaller line segments, adding a triangular point to each. This process then gets repeated over and over again:

The final curve is the result of doing this process an infinite number of times. Zooming in on any part of the snowflake gives a smaller version of the overall figure.

Fractals like the Koch snowflake have lots of weird mathematical properties. For example, each iteration above has a greater total length than the previous step. By replacing each line segment in the figure with four sections, the overall length of the curve keeps increasing. As it turns out, the eventual infinitely iterated curve ends up having an "infinite" length, even though it takes up a finite amount of space in the two-dimensional plane.

Read more: Any Rubik's Cube can be solved in 20 moves, but it took over 30 years for anyone to figure that out

Many shapes in nature have fractal-like properties. Crystals show the kind of repeating "self-similarity" that the Koch snowflake does; tree branches grow out into smaller and smaller versions of themselves; and lightning bolts follow fractal-like paths through the air.

But, as with many things in math, one of the earliest foundational studies of what would be later described as fractals came from a surprisingly difficult question: How long is the coastline of Great Britain?

While most people wouldn't lose sleep over this puzzle, it's the exact sort of problem that interests mathematicians — particularly when the answer turns out more complicated than expected.

It turns out that measuring the length of a coastline depends on the length of the ruler you're using, or the resolution of the map or photo being measured. That is somewhat counterintuitive, since most distances we might measure day to day don't change with the length of the ruler used to find them.

Coastlines can have large amounts of bends and kinks and odd edges, and so a smaller ruler or scale being used can measure a longer overall length of a coastline than a longer ruler, as the smaller ruler can capture more of those weird twists and turns.

As an example, here's a measurement of the coast of Great Britain using two different scales: one with a ruler about 100 miles long, and another using a second ruler half that length.

As your ruler gets smaller and smaller, the measured length of the coastline just keeps getting longer and longer.

In a seminal 1967 paper, mathematician Benoit Mandelbrot explored the relationship between changing the length of a ruler and the measured length of a coastline. Mandelbrot built off of earlier research by the mathematician Lewis Fry Richardson, who first observed the phenomenon of border measurements getting increasingly large as the unit of measurement got smaller.

Mandelbrot argued that the key reason for the increasing measured lengths with smaller rulers is that coastlines have a property he called "self-similarity." Roughly speaking, self-similarity means that zooming in on one part of a curve results in an area that looks somewhat similar to the larger part of the curve. Self-similar shapes are made up of smaller shapes that look like the larger shape.

Coastlines (like the British coast pictured above), tend to be very crinkly, with lots of zig-zagging areas and odd ins and outs. But zooming in closer, one sees a similar degree of crinkliness.

That self-similarity is the essential feature of what Mandelbrot would later name fractals.

Coastlines, of course, are not true fractals. While the self-similarity of a coastline extends pretty far, at the end of the day, coastlines are made up of atoms, and so the infinite levels of recursion that are possible in mathematical abstractions like the Koch snowflake are impossible with actual physical objects.

Some of the most interesting developments in math come out of the interplay between abstract concepts and actual physical things that exist in the real world. Fractals like the Mandelbrot set or the Koch snowflake are artifacts of pure geometry, but it took a strange attribute of coastlines to jump-start the study of this beautiful branch of math.