A Koch snowflake is an iteratively generated (fractal) shape built out of successively smaller equilateral triangles by following these steps:
  1. Draw an equilateral triangle. (n = 0)
  2. Divide the line segment into three segments of equal length.
  3. Draw an equilateral triangle that has the middle segment from step 2 as its base and points outward.
  4. remove the line segment that is the base of the triangle from step 3. (n = 1)
  5. Repeat steps 2 - 4. (n = 2,3,...)
In the limit of this shape has an infinite perimeter and a finite area. For , this perimeter is calculable. Calculate both of these values for any input value of n and any starting triangle edge length, s.
[A1,P1] = KochSnowflake(n,s)
n = 0,1,2,3 of Koch Snowflake

Solution Stats

13 Solutions

9 Solvers

Last Solution submitted on Mar 18, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers9

Suggested Problems

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!