canvas_collatz {aRtsy}R Documentation

Draw Collatz Sequences

Description

This function draws the Collatz conjecture on the canvas.

Usage

canvas_collatz(colors, background = "#fafafa", n = 200,
                angle.even = 0.0075, angle.odd = 0.0145, side = FALSE)

Arguments

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.

Value

A ggplot object containing the artwork.

Author(s)

Koen Derks, koen-derks@hotmail.com

References

https://nl.wikipedia.org/wiki/Collatz_Conjecture

See Also

colorPalette

Examples


set.seed(1)

# Simple example
canvas_collatz(colors = colorPalette("tuscany3"))



[Package aRtsy version 0.1.8 Index]