This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load packages | |
library(generative) # devtools::install_github("marcusvolz/generative") | |
library(ggplot2) | |
for (i in c(3, 86, 111)) { | |
# Set parameters | |
seed <- i | |
set.seed(seed) | |
n <- 400 | |
n_circles <- 4 # 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load packages | |
library(generative) # install_github("marcusvolz/generative") | |
library(tidyverse) | |
# Create lots of plots | |
for (i in 1:200) { | |
# Set paramter values | |
set.seed(i) | |
r_0 <- runif(1, 0, 1000) # 15000 | |
eps <- runif(1, 0, 500) # 550 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The shell math model is from the paper by M.B. Cortie (1989) | |
# https://www.researchgate.net/publication/238757952_Models_for_mollusc_shell_shape | |
# Load packages | |
library(mathart) # devtools::install_github("marcusvolz/mathart) | |
library(tidyverse) | |
# Set parameters (see mathart::mollusc() documentation for details) | |
n_s <- 650L | |
n_t <- 2000L |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The curve is a generalisation of the butterfly curve (Fay, 1989) | |
# See the Wiki for details: https://en.wikipedia.org/wiki/Butterfly_curve_(transcendental) | |
# Load packages | |
library(mathart) # devtools::install_github("marcusvolz/mathart") | |
library(tidyverse) | |
# Set parameters | |
n <- 1000 | |
a <- 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load packages | |
library(generative) # devtools::install_github("marcusvolz/generative") | |
library(ggplot2) | |
# Generate data (see generative::interpolate_squares documentation for details) | |
df <- interpolate_squares(seed = 1, n = 25, ease_function = "") | |
# Create plot | |
p <- ggplot() + | |
geom_segment(aes(x, y, xend = xend, yend = yend), df, alpha = 0.03, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load packages | |
library(generative) # devtools::install_github("marcusvolz/generative") | |
library(ggplot2) | |
# Set parameters (see generative::procedural_ring documentation for details) | |
seed <- 3 | |
n <- 400 | |
n_circles <- 4 | |
r_0 <- 500 | |
eps <- 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load packages | |
library(mathart) # devtools::install_github("marcusvolz/mathart") | |
library(tidyverse) | |
# Set parameters | |
# Rose curve wiki: https://en.m.wikipedia.org/wiki/Rose_(mathematics) | |
# Nearest neighbour graph wiki: https://en.m.wikipedia.org/wiki/Nearest_neighbor_graph | |
n <- 9 | |
d <- 8 # Note: k = n/d is a curve parameter | |
N <- 11 # Controls the total curve length |