From Robert Banks, Slicing Pizzas, Racing Turtles, and Further Adventures in Applied Mathematics [Banks02].
This project is simple: it does not use loops, if-statements or any data structures. This exercise focuses on expressions and assignment statements.
Facts about the American flag. The standard dimension is the width (or hoist). This is the basic unit that all others are multiplied by. A flag that is 30 inches wide will simply have 30 inches multiplied by all of the other measurements.





These are other facts; they are counts, not measurements.




Red Area. There are 4 red stripes which abut the blue field and 3 red stripes run the full length of the flag.
We can compute the area of the red, since it is 4 short rectangles and 3
long rectangles. The short rectangle areas are the width of a stripe
(
) times the whole length (length of the fly,
) less the width of
the blue union (
). The long rectangle areas are simply the width of
the stripe (
) times the length of the fly (
).

White Area. There are 3 white stripes which abut the blue field, 3 whie stripes run the full length of the flag, plus there are the 50 stars.
We can compute the basic area of the white using a similar analysis as
area of the red, and adding in the areas of the stars,
.
We’ll return to the area of the stars, last.

Blue Area. The blue area is the area of the union, less the area of
the stars,
.

Area of the Stars. A 5-sided star (pentagram) can be analyzed as 5 kites of 2 triangles. The area of each kite, K, is computed as follows.
The inner angles of all five kites fill the inside of the pentagram, and
the angles must sum to 360°, therefore each inner angle is
.
Angles of any triangle sum to 180°. The lower triangle is symmetric, therefore,
the other two angles must sum to 180. The lower triangle has two side
angles of
.
We see that straight lines contain an outer triangle and two inner
triangles. We know the inner triangles add to
; a straight line is
180. Therefore, the outer triangle has two 72° corners and a 36° peak. The area
of the two triangles can be computed from these two angles.

Recall that the radius of a star,
is
.
Here’s one version of the area of the kite.

Here’s the other version of the area of the kite.

Note that the math library math.sin() and math.cos() functions
operate in radians, not degrees. The conversion rule is
.
Therefore, we often see something like
for an angle,
a, in degrees.
The Golden Ratio is
(about 1.61803).
The total area of a star is

Given a specific width of a flag (in feet), we can compute the actual areas of each color.
Check Your Results. Blue is 18.73% of the total area.