canvas_chladni {aRtsy}R Documentation

Draw Chladni Figures

Description

This function draws Chladni figures on a canvas and subsequently warps the domain under these figures.

Usage

canvas_chladni(colors, waves = 5, warp = 0, resolution = 500,
               angles = NULL, distances = NULL)

Arguments

colors

a string or character vector specifying the color(s) used for the artwork.

waves

a character specifying the number of randomly sampled waves, or an integer vector of waves to be summed.

warp

a numeric value specifying the maximum warping distance for each point. If warp = 0 (the default), no warping is performed.

resolution

resolution of the artwork in pixels per row/column. Increasing the resolution increases the quality of the artwork but also increases the computation time exponentially.

angles

optional, a resolution x resolution matrix containing the angles for the warp, or a character indicating the type of noise to use (svm, knn, rf, perlin, cubic, simplex, or worley). If NULL (the default), the noise type is chosen randomly.

distances

optional, a resolution x resolution matrix containing the distances for the warp, or a character indicating the type of noise to use (svm, knn, rf, perlin, cubic, simplex, or worley). If NULL (the default), the noise type is chosen randomly.

Value

A ggplot object containing the artwork.

Author(s)

Koen Derks, koen-derks@hotmail.com

See Also

colorPalette

Examples


set.seed(2)

# Simple example
canvas_chladni(colors = colorPalette("origami"))

# Advanced example
canvas_chladni(colors = colorPalette("lava"), waves = c(1, 2, 3, 9), warp = 1)



[Package aRtsy version 0.1.8 Index]