Skip to contents

Calculates how oblong the shape of a group is, relative to its average moving direction, along with the properties of the minimum object oriented bounding box (OOBB) around all objects.

Usage

group_shape(x, y, hs, geo = FALSE)

Arguments

x

A vector of x (or longitude) coordinates.

y

A vector of y (or latitude) coordinates.

hs

A vector of headings of the objects (in degrees).

geo

A logical value indicating whether the locations are defined by geographic coordinates (pairs of longitude/latitude values). Default: FALSE.

Value

A list with the estimate of how oblong the group is, and the details of the bounding box, i.e. its coordinates, height, width, and orientation of its longest side in degrees.

Author

Marina Papadopoulou, m.papadopoulou.rug@gmail.com

Examples


x <- rnorm(25)
y <- rnorm(25, sd = 3)
h <- runif(25, 0, 2 * pi)
group_shape(x, y, h, geo = FALSE)
#> $pts
#>              X         Y
#> [1,] -2.934162  4.479794
#> [2,] -1.588409 -6.810192
#> [3,]  2.645547 -6.305510
#> [4,]  1.299794  4.984476
#> 
#> $height
#> [1] 4.263929
#> 
#> $width
#> [1] 11.36991
#> 
#> $angle
#>        Y 
#> 1.689435 
#> 
#> $shape
#>   hyvecs 
#> 1.132502 
#>