koch: Koch snowflake

View source: R/fractals.R

kochR Documentation

Koch snowflake

Description

Calculates or plots a Koch set of fractal lines, which is generated using a recursive algorithm that is built on a triangular hat shaped line segment. Each level of recursion replaces each linear segment by the same pattern.

Usage

koch(n = 4, plot = TRUE, res = 512)

Arguments

n

an integer value controling the number of recursive levels.

plot

logical. If TRUE, the Koch flake is plotted.

res

the number of pixels in each side of the output matrix

Value

a res x res matrix with 0s and 1s

Examples

koch()

geostats documentation built on Jan. 7, 2023, 5:32 p.m.

Related to koch in geostats...