Learn R Programming

cursr (version 0.1.0)

path_shape: Path along a Shape

Description

Calculate the path of a shape given supplied vertices.

Usage

path_shape(mat, cycle = TRUE, n = 30)

Arguments

mat

an Nx2 matrix of (row, col) coordinates

cycle

logical value determining whether to the first and last coordinates

n

number of points along each edge to calculate

Value

Nx2 matrix of (row, column) coordinates

See Also

Other path-fitting functions: path_arc(), path_bezier(), path_circle(), path_ellipse(), path_fill(), path_fn(), path_intersection(), path_lerp(), path_ray(), path_rect()

Examples

Run this code
# NOT RUN {
# Right Triangle
path_shape(rbind(
  c(10,1),
  c(10,10),
  c(1,1)
), cycle=TRUE)

# }

Run the code above in your browser using DataLab