canvas_collatz {aRtsy} | R Documentation |
This function draws the Collatz conjecture on the canvas.
canvas_collatz(colors, background = "#fafafa", n = 200,
angle.even = 0.0075, angle.odd = 0.0145, side = FALSE)
colors |
a string or character vector specifying the color(s) used for the artwork. |
background |
a character specifying the color used for the background. |
n |
a positive integer specifying the number of random starting integers to use for the lines. Can also be a vector of numbers to use as starting numbers. |
angle.even |
a value specifying the angle (in radials) to use in bending the sequence at each odd number. |
angle.odd |
a value specifying the angle (in radials) to use in bending the sequence at each even number. |
side |
logical. Whether to put the artwork on its side. |
A ggplot
object containing the artwork.
Koen Derks, koen-derks@hotmail.com
https://nl.wikipedia.org/wiki/Collatz_Conjecture
colorPalette
set.seed(1)
# Simple example
canvas_collatz(colors = colorPalette("tuscany3"))