- 0 ≤ population ≤ 100 (unit: percentage)
- 0 ≤ radius ≤ 40 (unit: pixels)
- 0 ≤ area ≤ 5026.55 (unit: pixels²)
The formulas given below use are functions of population, returning radius. This mimics the behavior of SVG's <circle> r
attribute.
- radius:
radius = 0.4 * population
- area:
A = population * area/100; radius = sqrt(A/π)
At the top and bottom are statically-computed circles. There are twelve, in equal increments (from 1/12 to 12/12). The top uses the by-radius formula, whereas the bottom uses the by-area formula. The black lines are shown as guides for the circle sizes.
In the middle are two circles. Each has its radius computed by the by-radius function (at left) or the by-area function (at right). Population ranges from 0 to 100 over five seconds.