なんか面白いのを見つけたのでテストしてみました。詳細は以下を。
Trigonometric Pattern Design | Ripples
なお上記の記事では一番上の模様しかコードを載せてなかったので、自分で多分これって感じで編集しました。
library("magrittr")
library("ggplot2")
library("pracma")
##
## Attaching package: 'pracma'
##
## 以下のオブジェクトは 'package:magrittr' からマスクされています:
##
## and, mod, or
RecurrencePlot = function(from, to, col1, col2) {
opt = theme(legend.position = "none",
panel.background = element_blank(),
axis.ticks = element_blank(),
panel.grid = element_blank(),
axis.title = element_blank(),
axis.text = element_blank())
seq(from, to, by = .1) %>% expand.grid(x=., y=.) %>%
ggplot( ., aes(x=x, y=y, fill=erf(sec(x)-sec(y)))) + geom_tile() +
scale_fill_gradientn(colours=colorRampPalette(c(col1, col2))(2)) + opt}
RecurrencePlot(from = -5*pi, to = 5*pi, col1 = "black", col2= "white")
RecurrencePlot2 = function(from, to, col1, col2) {
opt = theme(legend.position = "none",
panel.background = element_blank(),
axis.ticks = element_blank(),
panel.grid = element_blank(),
axis.title = element_blank(),
axis.text = element_blank())
seq(from, to, by = .1) %>% expand.grid(x=., y=.) %>%
ggplot( ., aes(x=x, y=y, fill=erf(tan(x)-tan(y)))) + geom_tile() +
scale_fill_gradientn(colours=colorRampPalette(c(col1, col2))(2)) + opt}
RecurrencePlot2(from = -5*pi, to = 5*pi, col1 = "black", col2= "white")
RecurrencePlot3 = function(from, to, col1, col2) {
opt = theme(legend.position = "none",
panel.background = element_blank(),
axis.ticks = element_blank(),
panel.grid = element_blank(),
axis.title = element_blank(),
axis.text = element_blank())
seq(from, to, by = .1) %>% expand.grid(x=., y=.) %>%
ggplot( ., aes(x=x, y=y, fill=erf(sin(x)-sin(y)))) + geom_tile() +
scale_fill_gradientn(colours=colorRampPalette(c(col1, col2))(2)) + opt}
RecurrencePlot3(from = -5*pi, to = 5*pi, col1 = "black", col2= "white")