PHP:Flags with Repeats Tutorial
The control variable i takes every value 0,1,2..9 in turn. We can use the value of i inside the loop if required.
The flag of Bahrain has a five irregular pentagons on a red background.
Each pentagon can be represented by five points such as (0,0), (64,0) (100,15) (64,31) and (0,31).
Consider the neighbouring state Qatar.
- 9 pillars, each pillar is 17 pixels below the previous.
- The five coordinates of the top pillar are (0,0) (84,0) (125,9) (84,17), (0,17)
- Use RGB(128,0,0) for the less jaunty red.
The need for a loop becomes even more obvious for this flag.
We need the trigonometry functions cos and sin to draw flags in a circle.
- There are 12 stars
- The flag is 250 by 180
- The stars centers are 64 from the center
- The coordinates at 30o from the x-axis (East) are 64*cos(30), 64*sin(30).
- Each star has radius 12.5