Skip to contents

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)
#> [1] FALSE FALSE FALSE FALSE FALSE
is_cw_convex(lns)
#> [1] FALSE FALSE FALSE FALSE FALSE
is_ccw_convex(lns)
#> [1] FALSE FALSE FALSE FALSE FALSE
is_strictly_convex(lns)
#> [1] FALSE FALSE FALSE FALSE FALSE
is_strictly_cw_convex(lns)
#> [1] FALSE FALSE FALSE FALSE FALSE
is_strictly_ccw_convex(lns)
#> [1] FALSE FALSE FALSE FALSE FALSE