sfc_previous_point: The previous and the next point

sfc_previous_point,sfc_base-methodR Documentation

The previous and the next point

Description

The previous and the next point

Usage

## S4 method for signature 'sfc_base'
sfc_previous_point(p, x, rot, length = 1)

## S4 method for signature 'sfc_base'
sfc_next_point(p, x, rot, length = 1)

Arguments

p

An sfc_base object.

x

The coordinate of the current point.

rot

Rotation of the current point.

length

Length of the segment between the previous/next point and the current point.

Value

A vector of length two.

Examples

sfc_previous_point(BASE_R, c(0, 0), 0)
sfc_previous_point(BASE_R, c(0, 0), 90)
sfc_previous_point(BASE_R, c(0, 0), 180)
sfc_previous_point(BASE_R, c(1, 0), 0)
sfc_previous_point(BASE_R, c(1, 0), 90)
sfc_previous_point(BASE_R, c(1, 0), 180)
sfc_next_point(BASE_R, c(0, 0), 0)
sfc_next_point(BASE_R, c(0, 0), 90)
sfc_next_point(BASE_R, c(0, 0), 180)
sfc_next_point(BASE_R, c(1, 0), 0)
sfc_next_point(BASE_R, c(1, 0), 90)
sfc_next_point(BASE_R, c(1, 0), 180)

sfcurve documentation built on Sept. 14, 2024, 1:07 a.m.