angle_path: Draw angle path plots Implementation of the 'AnglePath'...

Description Usage Arguments See Also Examples

View source: R/angle_path.R

Description

Draw angle path plots Implementation of the AnglePath function from the Wolfram language.

Usage

1
2
angle_path(theta, length = 1, start = c(0, 0), deg = FALSE, plot = TRUE,
  ...)

Arguments

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 plot.

See Also

nest

Examples

 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)

parksw3/wolframR documentation built on May 24, 2019, 6:16 p.m.