Draw the flag of the United Kingdom in the center of the canvas. It is 300 units wide and 150 units high.

The flag has many shapes. Draw them in this order, so the top shapes cover the lower ones. Use goto to visit the corner points of each shape. A point is written as (x, y).

  1. Draw a rectangle of 300 by 150 units and color it #012169 (dark blue). Its corners are (-150, 75), (150, 75), (150, -75) and (-150, -75).
  2. Draw two white diagonal stripes from corner to corner. Use white and these points:
    • Stripe 1: (-150, 75), (-116.46, 75), (150, -58.23), (150, -75), (116.46, -75), (-150, 58.23).
    • Stripe 2: (150, 75), (116.46, 75), (-150, -58.23), (-150, -75), (-116.46, -75), (150, 58.23).
  3. Draw four thin #C8102E (red) strips on the diagonals. Each strip lies next to the middle of a white stripe. Use these points:
    • Bottom right: (0, 0), (150, -75), (150, -63.82), (0, 11.18).
    • Top left: (0, 0), (-150, 75), (-150, 63.82), (0, -11.18).
    • Bottom left: (0, 0), (-150, -75), (-127.64, -75), (0, -11.18).
    • Top right: (0, 0), (150, 75), (127.64, 75), (0, 11.18).
  4. Draw a white cross over the middle. Both bars are 50 units thick. The vertical bar is 50 units wide and 150 units high. The horizontal bar is 300 units wide and 50 units high.
  5. Draw a #C8102E (red) cross on top of the white cross. Both bars are 30 units thick, so the white border is 10 units on each side.
  6. Add a thin black outline around the flag’s outer edge.

flag of the United Kingdom