star: Create star plots

Description Usage Arguments Details Examples

View source: R/star.R

Description

Create star plots

Usage

1
star(fat = 0.8, n_flairs = 5, theta = 0, plot = FALSE, add = FALSE)

Arguments

fat

A number between 0 and 1. This parameter controls the relative distance from the star's inner radius to the outer radius. Values close to 0 generate long spikes; values close to 1 generate fat spikes.

n_flairs

An integer. The number of spikes on the star.

theta

A number between 0 and 2*pi. The degree (in radians) of rotation.

plot

TRUE or FALSE. Should the star be plotted.

add

TRUE or FALSE. Should the star be added to the current plot, or should a new plot be generated.

Details

Inivisibly returns a list of coordinates of star spikes. Each element of the list is a spike. If plot = TRUE, then the star is plotted.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
require(magrittr)
star(.8,5,pi/2, plot = TRUE)
for(k in seq(.3, .8, by = 0.01)) star(k,5,pi/2, plot = TRUE, add = TRUE) 

star(.87,6,pi/2, plot = TRUE)
for(k in seq(.4, .87, by = 0.01)) star(k,6,pi/2, plot = TRUE, add = TRUE) 

star(.1, 2, plot = TRUE)
for(k in 3:35) star(.1, k, plot = TRUE, add = TRUE)

star(.09, 4, plot = TRUE)
for(k in seq(.99, .01, by = -0.02)) star(k, 4, plot = TRUE, add = TRUE)

star(.99, 5, plot = TRUE)
for(k in seq(.99, .01, by = -0.02)) star(k, 5, plot = TRUE, add = TRUE)

star(.99, 6, plot = TRUE)
for(k in seq(.99, .01, by = -0.02)) star(k, 6, plot = TRUE, add = TRUE)

star(.99, 3, plot = TRUE)
for(k in seq(.99, .01, by = -0.02)) star(k, 3, plot = TRUE, add = TRUE)

thomasgstewart/tgsify documentation built on June 18, 2020, 11:10 a.m.