Learn R Programming

rsgeo (version 0.1.7)

is_convex: 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)

Value

a logical vector

Arguments

x

an object of class rs_LINESTRING

See geo docs for further details

Examples

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

Run the code above in your browser using DataLab