convex: Determine the Convexity of a LineString

is_convexR Documentation

Determine the Convexity of a LineString

Description

For a given rs_LINESTRING vector, test its convexity. Convexity can be tested strictly or strongly, as well as based on winding.

Usage

is_convex(x)

is_ccw_convex(x)

is_cw_convex(x)

is_strictly_convex(x)

is_strictly_ccw_convex(x)

is_strictly_cw_convex(x)

Arguments

x

an object of class rs_LINESTRING

See geo docs for further details

Value

a logical vector

Examples

lns <- geom_linestring(
    1:20,
    runif(20, -5, 5),
    rep.int(1:5, 4)
  )
  
is_convex(lns)
is_cw_convex(lns)
is_ccw_convex(lns)
is_strictly_convex(lns)
is_strictly_cw_convex(lns)
is_strictly_ccw_convex(lns)

rsgeo documentation built on Sept. 9, 2023, 1:07 a.m.