spline.poly: Splining a polygon with 'stats::spline'

View source: R/spline.poly.R

spline.polyR Documentation

Splining a polygon with stats::spline

Description

whuber's spline.poly as shared in StackExchange

Usage

spline.poly(xy, vertices, k = 3, ...)

Arguments

xy

A data.frame with ordered X/Y pairs representing the polygon

vertices

The amount of vertices in the final smoothing/interpolation.

k

The amount of points used to "close" the path, and prevent discontinuous derivatives at the end-points.

Details

See: https://gis.stackexchange.com/a/24929

The rows of 'xy' give coordinates of the boundary vertices, in order. 'vertices' is the number of spline vertices to create. (Not all are used: some are clipped from the ends.) 'k' is the number of points to wrap around the ends to obtain a smooth periodic spline.

Value

Returns an array of points.


gerbeldo/tidycell documentation built on Aug. 15, 2022, 2:35 p.m.