Rectangle accessors and operators

rct_xmin(x)

rct_ymin(x)

rct_xmax(x)

rct_ymax(x)

rct_width(x)

rct_height(x)

rct_intersects(x, y)

rct_contains(x, y)

rct_intersection(x, y)

Arguments

x, y

rct() vectors

Value

  • rct_xmin(), rct_xmax(), rct_ymin(), and rct_ymax() return the components of the rct().

Examples

x <- rct(0, 0, 10, 10)
y <- rct(5, 5, 15, 15)

rct_xmin(x)
#> [1] 0
rct_ymin(x)
#> [1] 0
rct_xmax(x)
#> [1] 10
rct_ymax(x)
#> [1] 10
rct_height(x)
#> [1] 10
rct_width(x)
#> [1] 10
rct_intersects(x, y)
#> [1] TRUE
rct_intersection(x, y)
#> <wk_rct[1]>
#> [1] [5 5 10 10]
rct_contains(x, y)
#> [1] FALSE
rct_contains(x, rct(4, 4, 6, 6))
#> [1] TRUE