Stefan Siegert

2D generative art in R

Last update: 2022-06-25

Random Fourier modes

set.seed(123)
n = 200
nmod = 5
mat = matrix(0, n, n)
mat[1:nmod, 1:nmod] = rnorm(nmod^2) + 1i * rnorm(nmod^2)
imat = Re(fft(mat, inverse=TRUE))
image(imat, axes=FALSE)
plot of chunk unnamed-chunk-1

Random Voronoi Tesselation

library(tidyverse)
library(ggvoronoi) # install_github("garretrc/ggvoronoi")
set.seed(123)
n = 200
dat = tibble(x = runif(n), y=runif(n), z=sin(pi*x)*y)
ggplot(dat) +
  geom_voronoi(aes(x=x, y=y, fill=z), show.legend=FALSE) +
  scale_fill_viridis_c() +
  theme_void()
plot of chunk unnamed-chunk-4