ststar() generates a classical star polygon {n/k} by placing n pegs on
a circle and connecting each peg to the peg k positions ahead.
Usage
ststar(
n = 5,
k = 2,
col = "blue",
lwd = 1,
plot = TRUE,
show_points = TRUE,
show_labels = FALSE,
verbose = FALSE,
radius = 1,
rotate = pi/2,
show_strings = TRUE,
template = FALSE,
draw_polygon = TRUE,
border_col = "grey50",
border_lwd = 1,
point_col = "black",
point_cex = 0.8,
point_pch = 19,
point_bg = "white",
label_cex = 0.7,
label_col = "black",
bg = "white",
main = NULL
)Arguments
- n
Integer. Number of pegs on the circle. Must be at least 3.
- k
Integer. Star step. Must satisfy
1 <= k <= n - 1.- col
String color passed to
graphics::segments().- lwd
Positive number. Line width used to draw the star.
- plot
Logical. If
TRUE, draws the figure.- show_points
Logical. If
TRUE, draws the pegs.- show_labels
Logical. If
TRUE, draws peg labels.- verbose
Logical. If
TRUE, prints a short audit to the console.- radius
Positive number. Circle radius.
- rotate
Numeric. Rotation angle in radians applied to the star.
- show_strings
Logical. If
TRUE, draws the star connections.- template
Logical. If
TRUE, draws only the peg template, without star connections. This is equivalent to settingshow_strings = FALSEandshow_points = TRUE.- draw_polygon
Logical. If
TRUE, draws the underlying regular polygon.- border_col
Polygon border color.
- border_lwd
Positive number. Border line width.
- point_col
Peg color.
- point_cex
Positive number. Peg size.
- point_pch
Plotting symbol used for pegs.
- point_bg
Peg background color when applicable.
- label_cex
Positive number. Label size.
- label_col
Label color.
- bg
Plot background color.
- main
Optional plot title. If
NULL, no title is displayed.
Value
Invisibly returns a list of class stringart_result with:
- pegs
A
data.framewith columnsindex,x, andy.- connections
A
data.framewith columnsconnection_index,from,to,x_from,y_from,x_to,y_to, andlength.- total_length
Total string length.
- audit
A character vector with audit information.
- meta
A list with construction metadata.




