What this calculator does
The Koch snowflake starts as an equilateral triangle of side a. In each iteration every straight segment of the outline is divided into three equal parts and the middle part is replaced by the two other sides of an equilateral triangle built outwards on it. After n iterations the outline has 3·4ⁿ segments of length a/3ⁿ; each of its three sides is a Koch curve of order n.
Derivation of the formulas
Perimeter:
$$ P = 3a\left(\frac{4}{3}\right)^n $$
Area:
$$ A = \frac{\sqrt{3} }{4}a^2\left(\frac{8}{5} - \frac{3}{5}\left(\frac{4}{9}\right)^n\right) $$
Segments:
$$ 3\cdot 4^n \text{ segments of length } \frac{a}{3^n} $$
Limit area:
$$ A_\infty = \frac{2\sqrt{3} }{5}a^2 $$
Each iteration replaces one segment by four segments a third as long, so the number of segments is multiplied by 4 and the perimeter by 4/3: P = 3a(4/3)ⁿ. Iteration k adds one small equilateral triangle on each of the 3·4^(k−1) segments, each of side a/3^k and area (√3/4)a²/9^k, so it adds (√3/4)a²·(3/9)(4/9)^(k−1). Summing this geometric series from k = 1 to n and adding the starting triangle gives A = (√3/4)a²(1 + (3/5)(1 − (4/9)ⁿ)) = (√3/4)a²(8/5 − (3/5)(4/9)ⁿ). As n grows the area tends to 8/5 of the triangle, while the perimeter grows without bound.
Solving from what you know
Choose what you know: Side a of the starting triangle and iterations n; Perimeter P and iterations n; Area A and iterations n. The calculator first finds the sizes that define the curve and then computes every other value from the formulas above. Each length is accepted from 0.000001 to 1,000,000,000, each area from 0.000000000001 to 1,000,000,000,000,000,000; anything outside is refused with a sentence that names the range. The number of iterations is a whole number from 0 (the triangle itself) to 15.
Worked example
With the defaults a = 9 and n = 3: the outline has 192 segments of length 1/3, so P = 64; the area is (√3/4)·81·(8/5 − (3/5)(64/729)) ≈ 54.270925, a little below the limit 56.118446.
Results are accurate to at least 9 significant digits for ordinary inputs. When a result depends on the small difference of two nearly equal entries (closer than one part in a million), fewer digits are reliable. They are shown with up to 6 decimal places; a value below 0.000001 or of 10¹⁵ and more is shown as its plain 12-digit number instead. The unit you pick is a label: lengths are shown in that unit and areas in its square.
Frequently asked questions
Is this the Koch curve or the Koch snowflake?
Both: the snowflake is three Koch curves built on the sides of an equilateral triangle. The length of one Koch curve of order n on a segment of length a is a(4/3)ⁿ, shown as its own row.
How can the perimeter be infinite while the area stays finite?
Each iteration multiplies the perimeter by 4/3, so it grows without bound, but the triangles it adds shrink by a factor 4/9 in total area each time, a converging series: the area never exceeds 8/5 of the starting triangle.
How accurate are the results?
Results are accurate to at least 9 significant digits for ordinary inputs. When a result depends on the small difference of two nearly equal entries (closer than one part in a million), fewer digits are reliable.
References
Benoit B. Mandelbrot, The Fractal Geometry of Nature, W. H. Freeman, 1982
D. Zwillinger (ed.), CRC Standard Mathematical Tables and Formulas, 33rd edition, CRC Press, 2018