Flag of the United States
Author
Senan Sekhon
Last Updated
4년 전
License
Creative Commons CC BY 4.0
Abstract
Flag of the United States of America, according to official government specifications
Flag of the United States of America, according to official government specifications
\documentclass[10pt]{article}
%This is the minimal setup required to render the flag
\usepackage[paperwidth=247cm, paperheight=130cm, top=0cm, bottom=0cm, left=0cm, right=0cm]{geometry}
%Paper width is set to 247cm by 130 cm to match the US Government-specified aspect ratio (1.9:1)
\usepackage{tikz}
%\usepackage[dvipsnames]{xcolor} % Optional unless you want to use colors pre-defined by the xcolor package
% US Government-specified colors for the flag
\definecolor{ssred}{RGB}{179,25,66}
\definecolor{sswhite}{RGB}{255,255,255}
\definecolor{ssblue}{RGB}{10,49,97}
% Other government specifications include:
% Stripe width is 1/13 flag width, here it is 10cm
% Diameter of each star is 4/5 width of each stripe, here it is 8cm
% Width of canton is 2/5 flag width, here it is 98.8cm
% Height of canton is 7/13 flag height, here it is 70cm
%Source: https://eca.state.gov/files/bureau/state_department_u.s._flag_style_guide.pdf
%Created by Senan Sekhon, July 4, 2020
%Happy 4th of July everyone!
\begin{document}
\begin{center} %Optional, but helps to tidy up the layout
\begin{tikzpicture}[scale=1] %Scale must be changed to make the flag fit on letter/A4 paper (scale=1 produces a 247 cm by 130 cm flag)
\clip (-123.5,-65) rectangle (123.5,65); %Optional, crops the flag to the correct size
\draw[-] (-123.5,-65)--(-123.5,65)--(123.5,65)--(123.5,-65)--cycle; %Optional, draws a border around the flag
%Red stripes below the canton (full-length):
\foreach \y in {-65,-45,-25}
\fill[ssred] (-123.5,\y)--(123.5,\y)--(123.5,\y+10)--(-123.5,\y+10)--cycle;
%White stripes below the canton (full-length):
\foreach \y in {-55,-35,-15}
\fill[sswhite] (-123.5,\y)--(123.5,\y)--(123.5,\y+10)--(-123.5,\y+10)--cycle;
%Red stripes beside the canton (3/5-length):
\foreach \y in {-5,15,35,55}
\fill[ssred] (-24.7,\y)--(123.5,\y)--(123.5,\y+10)--(-24.7,\y+10)--cycle;
%White stripes beside the canton (3/5-length):
\foreach \y in {5,25,45}
\fill[sswhite] (-24.7,\y)--(123.5,\y)--(123.5,\y+10)--(-24.7,\y+10)--cycle;
%Canton background:
\fill[ssblue] (-123.5,-5)--(-24.7,-5)--(-24.7,65)--(-123.5,65)--cycle;
%Outer stars (5 rows of 6):
\foreach \x in {-1729/15,-494/5,-247/3,-988/15,-247/5,-494/15}
\foreach \y in {2,16,30,44,58}
\fill[sswhite] (\x,\y+4)--({\x+sqrt(50-22*sqrt(5))},{\y-1+sqrt(5)})--({\x+sqrt(10+2*sqrt(5))},{\y-1+sqrt(5)})--({\x+2*sqrt(5-2*sqrt(5))},{\y+4-2*sqrt(5)})--({\x+sqrt(10-2*sqrt(5))},{\y-1-sqrt(5)})--(\x,{\y-6+2*sqrt(5)})--({\x-sqrt(10-2*sqrt(5))},{\y-1-sqrt(5)})--({\x-2*sqrt(5-2*sqrt(5))},{\y+4-2*sqrt(5)})--({\x-sqrt(10+2*sqrt(5))},{\y-1+sqrt(5)})--({\x-sqrt(50-22*sqrt(5))},{\y-1+sqrt(5)})--cycle;
%Inner stars (4 rows of 5):
\foreach \x in {-3211/30,-2717/30,-741/10,-1729/30,-247/6}
\foreach \y in {9,23,37,51}
\fill[sswhite] (\x,\y+4)--({\x+sqrt(50-22*sqrt(5))},{\y-1+sqrt(5)})--({\x+sqrt(10+2*sqrt(5))},{\y-1+sqrt(5)})--({\x+2*sqrt(5-2*sqrt(5))},{\y+4-2*sqrt(5)})--({\x+sqrt(10-2*sqrt(5))},{\y-1-sqrt(5)})--(\x,{\y-6+2*sqrt(5)})--({\x-sqrt(10-2*sqrt(5))},{\y-1-sqrt(5)})--({\x-2*sqrt(5-2*sqrt(5))},{\y+4-2*sqrt(5)})--({\x-sqrt(10+2*sqrt(5))},{\y-1+sqrt(5)})--({\x-sqrt(50-22*sqrt(5))},{\y-1+sqrt(5)})--cycle;
\end{tikzpicture}
\end{center}
\end{document}