Learn R Programming

sfcurve (version 1.0.0)

sfc_previous_point,sfc_base-method: The previous and the next point

Description

The previous and the next point

Usage

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

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

Value

A vector of length two.

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.

Examples

Run this code
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)

Run the code above in your browser using DataLab