Created
February 24, 2019 18:10
-
-
Save alistaire47/6299fd5ee44f1dd87b339cc7eaabffdc to your computer and use it in GitHub Desktop.
squircles
This file contains hidden or 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
library(tidyverse) | |
library(gganimate) | |
animate( | |
crossing( | |
p = seq(0.1, 5, by = 0.1), | |
theta = seq(0, 2*pi, length.out = 101) | |
) %>% | |
mutate(r = 1 / (abs(cos(theta))^p + abs(sin(theta))^p)^(1/p)) %>% | |
ggplot(aes(theta, r, fill = p)) + | |
geom_area(show.legend = FALSE) + | |
scale_fill_viridis_c(option = 'A') + | |
coord_polar() + | |
theme_void() + | |
transition_time(p), | |
rewind = TRUE, | |
nframes = 300, | |
fps = 100/3, | |
device = "svglite", | |
renderer = magick_renderer(), | |
width = 5, height = 5 | |
) |
Author
alistaire47
commented
Feb 24, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment