Description Usage Arguments See Also Examples
Draw angle path plots
Implementation of the AnglePath
function from the Wolfram language.
1 2 |
theta |
a numeric vector containing angle at each step. |
length |
a numeric vector containing lenghths of each segment. |
start |
a numeric vector containing starting poistion. |
deg |
a logical indicating whether degree should be used instead of radian. |
... |
additional arguments to be passed to |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Some of these examples are directly taken from the Wolfram documentation
angle_path(seq(0, 10, 0.01))
angle_path(c(30, 50, -40), c(3, 2, 1), deg = TRUE)
## Create a regular n-gon
n <- 5
angle_path(rep(360/n, n), deg = TRUE)
## Make a random walk where successive change direction by at most 20 degrees
angle_path(runif(1000, min = -20, max = 20), deg = TRUE)
## Dragon curve
angle_path(c(90, -90)[1 + nest(0, c(x, 0, rev(1-x)), 10)], deg = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.