chrisphan.com

Minnesota's new flag: from scratch

An analog clock reading 12:402024-04-30 / 2024-W18-2T12:40:00-05:00 / 0x66312cf0

Categories: programming, Minnesota

A new flag

Minnesota is soon getting a new state flag.

New flag of Minnesota. The flag is divided into two parts. The right is water blue, and the left is night sky blue. The boundary between the two sides is a V-shape, pointing left. In the middle of the left portion is an eight-pointed star.
New design for Minnesota's flag, to be adopted 2024-05-11.

In May 2023, the Minnesota Legislature passed, and the governor signed, HF 1830, a state government finance bill that also created a commission to redesign Minnesota's state flag and state seal. The previous flag design uses the classic "seal on a bedsheet" arrangement decried by vexillologists.1 Seals and flags have opposite purposes: seals are supposed to be complicated while flags are supposed to be simple and recognizable from a distance.2

Old flag of Minnesota. It's the state seal, which includes the word MINNESOTA, on a blue background.
The previous flag design (Public Domain, from Wikipedia)

In the second half of 2023, the State Emblems Redesign Commission invited members of the public to submit proposed designs for Minnesota's new flag and seal. Many designs were proposed. The winning proposal was proposal F1953, designed and submitted by Andrew Prekker of Luverne, Minnesota. The commission adopted a simplified version of Prekker's design this past December. This design will be adopted on May 11, the 166th anniversary of Minnesota statehood. The new design is thought to be one of the best in the nation.

In this post, I will explain how to implement the design of this flag as a short manually-coded SVG file.

The specifications

The new flag as a very simple design, specified by the State Emblems Redesign Commission in its official report (p. 21). You can make the flag out of three shapes:

diagram from the SERC report, showing the shapes described below

Official specification from the State Emblems Redesign Commission

Coding the flag

We can use these descriptions to write our SVG file.

Outside element

We begin with the outside svg element, which defines the viewport. Since the flag sits inside of a \(n \times 5n/3\) rectangle, we'll set \(n = 300\), so that the flag's dimensions are 500 × 300.

Typically, in computer graphics, the \(y\) coordinates increase as you go down, which is the opposite of the convention used in mathematics. So, our viewport's upper-left corner will be at \((0, 0)\), and the lower right corner will be at \((500, 300)\). This is expressed in SVG with the attribute viewbox="0 0 500 300" in the svg element.

mn_flag.svg SVG
<svg viewbox="0 0 500 300" xmlns='http://www.w3.org/2000/svg'>
</svg>

Water blue rectangle

The next element to add is a water blue (#52c9e8) rectangle with the same dimensions as the viewport. We'll use the rect element for this. We insert the rect inside the svg element.

mn_flag.svg SVG
<svg viewbox="0 0 500 300" xmlns='http://www.w3.org/2000/svg'>
  <rect x="0" y="0" width="500" height="300" stroke="none" fill="#52c9e8" />
</svg>

Night sky blue pentagon

The next element to add is the night-sky blue (#002d5d) pentagon. For this, we'll use the polygon element.3 Setting \(n = 300\), we see that the points of the vertices of the pentagon are at the following coordinates: \[(0, 0), (280, 0), (195, 150), (280, 300), (0, 300).\] So, we insert after the rect:

mn_flag.svg SVG

  <polygon points="0,0 280,0 195,150 280,300 0,300"
    stroke="none" fill="#002d5d" />

White star

Last, and most tricky, is the eight-pointed star that goes inside the pentagon. To get these points, we are going to use some trigonometry. If a circle has radius \(r\) and center at the origin, then each point \(P\) on the circle has the form \[P = (r \cos \theta, r \sin \theta),\] where \(\theta\) is the angle between the positive \(x\)-axis and the ray starting at the center of the circle and passing through \(P\). For a circle with arbitrary center \((h, k),\) we translate to get the parameterization \[P = (h + r \cos \theta, k + r \sin \theta).\]

diagram illustrating the above
Parameterization of an arbitrary point on a circle

In our case, the points of the star sit on a circle with center \(105, 150)\) and radius 55. There are eight points equally spaced around the circle, with two points on the same horizontal line as the center, so the appropriate angles are 0°, 45°, 90°, 135°, and so on—or, in radians, \(0, \pi/4, \pi/2, 3\pi/4, \dots\). However, we create the star by attaching each point to a point three away, so the first point has an angle of \(0\), the next an angle of \(3\pi/4\), the next an angle of \(3\pi/2\), etc. Specifically, the \(j\)th point will have an angle of \(3j\pi/4\), and so the \(j\)th point will have coordinates \[(105 + 55 \cos(3j\pi/4), 150 + 55 \sin(3j\pi/4)).\]

We could compute these by hand (using knowledge of trigonometry and a decimal approximation for \(\sqrt{2}/2\)), but a short Python script is perfect for this.

star_points.py Python
"""Calculate the points of the star on the Minnesota flag"""
import math

center_x = 105
center_y = 150
r = 55

theta = [3 * k * math.pi / 4 for k in range(0, 9)]
p = [(center_x + r * math.cos(k), center_y + r * math.sin(k)) for k in theta]

for pt in p:
    print(f"{pt[0]:08.8f},{pt[1]:08.8f}")

We run this script to get the coordinates:

Bash
python3 star_points.py
160.00000000,150.00000000
66.10912703,188.89087297
105.00000000,95.00000000
143.89087297,188.89087297
50.00000000,150.00000000
143.89087297,111.10912703
105.00000000,205.00000000
66.10912703,111.10912703
160.00000000,150.00000000

Now, we use the polyline SVG element, inserting the following after the pentagon in our SVG file:

mn_flag.svg SVG

  <polyline points="
    160.00000000,150.00000000
    66.10912703,188.89087297
    105.00000000,95.00000000
    143.89087297,188.89087297
    50.00000000,150.00000000
    143.89087297,111.10912703
    105.00000000,205.00000000
    66.10912703,111.10912703
    160.00000000,150.00000000"
    stroke="none" fill="white" />

Final result

The final result is this short SVG file:

mn_flag.svg SVG
<svg viewbox="0 0 500 300" xmlns='http://www.w3.org/2000/svg'>
  <rect x="0" y="0" width="500" height="300" stroke="none" fill="#52c9e8" />
  <polygon points="0,0 280,0 195,150 280,300 0,300"
    stroke="none" fill="#002d5d" />
  <polyline points="
    160.00000000,150.00000000
    66.10912703,188.89087297
    105.00000000,95.00000000
    143.89087297,188.89087297
    50.00000000,150.00000000
    143.89087297,111.10912703
    105.00000000,205.00000000
    66.10912703,111.10912703
    160.00000000,150.00000000"
    stroke="none" fill="white" />
</svg>

And it looks like this:

New flag of Minnesota. The flag is divided into two parts. The right is water blue, and the left is night sky blue. The boundary between the two sides is a V-shape, pointing left. In the middle of the left portion is an eight-pointed star.

What a beautiful flag!

Footnotes

  1. The seal in question was also considered distasteful by many for its celebration of settler-colonialism, and so the same commission that redesigned the flag also came up with a new seal. But even if the seal had been perfectly fine, as the new seal is, putting your state seal on a flag is a terrible flag design.

  2. The North American Vexillological Association has identified five principles of flag design, several of which the old design clearly violates.

  3. We could have used a polygon for the sky blue rectangle as well.